Message ID | 20220128221909.8141-12-bvanassche@acm.org |
---|---|
State | Superseded |
Headers | show |
Series | Remove the SCSI pointer from struct scsi_cmnd | expand |
On Fri, 2022-01-28 at 14:18 -0800, Bart Van Assche wrote: > @@ -240,7 +239,7 @@ static int aha1542_test_port(struct Scsi_Host > *sh) > for (i = 0; i < 4; i++) { > if (!wait_mask(STATUS(sh->io_port), DF, DF, 0, 0)) > return 0; > - inquiry_result[i] = inb(DATA(sh->io_port)); > + inb(DATA(sh->io_port)); > } Maybe: (void)inb(DATA(sh->ip_port)); so it's obvious we don't care about the read data. Otherwise, Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
On 1/31/22 02:25, Johannes Thumshirn wrote: > On Fri, 2022-01-28 at 14:18 -0800, Bart Van Assche wrote: >> @@ -240,7 +239,7 @@ static int aha1542_test_port(struct Scsi_Host >> *sh) >> for (i = 0; i < 4; i++) { >> if (!wait_mask(STATUS(sh->io_port), DF, DF, 0, 0)) >> return 0; >> - inquiry_result[i] = inb(DATA(sh->io_port)); >> + inb(DATA(sh->io_port)); >> } > > > Maybe: > (void)inb(DATA(sh->ip_port)); > > so it's obvious we don't care about the read data. I will make that change. Thanks for all the reviews! Bart.
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index f0e8ae9f5e40..c7a735e581c8 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c @@ -206,7 +206,6 @@ static int makecode(unsigned hosterr, unsigned scsierr) static int aha1542_test_port(struct Scsi_Host *sh) { - u8 inquiry_result[4]; int i; /* Quick and dirty test for presence of the card. */ @@ -240,7 +239,7 @@ static int aha1542_test_port(struct Scsi_Host *sh) for (i = 0; i < 4; i++) { if (!wait_mask(STATUS(sh->io_port), DF, DF, 0, 0)) return 0; - inquiry_result[i] = inb(DATA(sh->io_port)); + inb(DATA(sh->io_port)); } /* Reading port should reset DF */
This patch fixes the following W=1 warning: drivers/scsi/aha1542.c:209:12: warning: variable ‘inquiry_result’ set but not used [-Wunused-but-set-variable] 209 | u8 inquiry_result[4]; Signed-off-by: Bart Van Assche <bvanassche@acm.org> --- drivers/scsi/aha1542.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)