Skip to content

Commit

Permalink
hpsa: fix non-x86 builds
Browse files Browse the repository at this point in the history
commit 28e1344 "[SCSI] hpsa: enable unit attention reporting"
turns on unit attention notifications, but got the change wrong for
all architectures other than x86, which now store an uninitialized
value into the device register.

Gcc helpfully warns about this:

../drivers/scsi/hpsa.c: In function 'hpsa_set_driver_support_bits':
../drivers/scsi/hpsa.c:6373:17: warning: 'driver_support' is used uninitialized in this function [-Wuninitialized]
  driver_support |= ENABLE_UNIT_ATTN;
                 ^

This moves the #ifdef so only the prefetch-enable is conditional
on x86, not also reading the initial register contents.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 28e1344 "[SCSI] hpsa: enable unit attention reporting"
Cc: stable@vger.kernel.org # v3.14+
Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Arnd Bergmann authored and Christoph Hellwig committed Jul 25, 2014
1 parent 6aa4c36 commit 0b9e7b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/hpsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -6366,9 +6366,9 @@ static inline void hpsa_set_driver_support_bits(struct ctlr_info *h)
{
u32 driver_support;

#ifdef CONFIG_X86
/* Need to enable prefetch in the SCSI core for 6400 in x86 */
driver_support = readl(&(h->cfgtable->driver_support));
/* Need to enable prefetch in the SCSI core for 6400 in x86 */
#ifdef CONFIG_X86
driver_support |= ENABLE_SCSI_PREFETCH;
#endif
driver_support |= ENABLE_UNIT_ATTN;
Expand Down

0 comments on commit 0b9e7b7

Please sign in to comment.