OSDN Git Service

scsi: aic7xxx: Fix 'amount_xferred' set but not used issue
authorLee Jones <lee.jones@linaro.org>
Mon, 13 Jul 2020 07:46:37 +0000 (08:46 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 15 Jul 2020 20:01:58 +0000 (16:01 -0400)
commitaa89d74e040aa0b91e06566ea28a532f937630c2
tree6c7b10dfdc36b66153077bb64d6e748270ee834c
parent7097a517446fe62c6c53e3988e0d4fe536c35b17
scsi: aic7xxx: Fix 'amount_xferred' set but not used issue

'amount_xferred' is used, but only in certain circumstances.  Place the
same stipulations on the defining/allocating of 'amount_xferred' as is
placed when using it.

We've been careful not to change any of the ordering semantics here.

Fixes the following W=1 kernel build warning(s):

 drivers/scsi/aic7xxx/aic7xxx_osm.c: In function ‘ahc_done’:
 drivers/scsi/aic7xxx/aic7xxx_osm.c:1725:12: warning: variable ‘amount_xferred’ set but not used [-Wunused-but-set-variable]
 1725 | uint32_t amount_xferred;
 | ^~~~~~~~~~~~~~

Link: https://lore.kernel.org/r/20200713074645.126138-22-lee.jones@linaro.org
Cc: Hannes Reinecke <hare@suse.com>
Cc: "Daniel M. Eischen" <deischen@iworks.InterWorks.org>
Cc: Doug Ledford <dledford@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/aic7xxx/aic7xxx_osm.c