linux/drivers/scsi/qla4xxx
Arnd Bergmann 860cd9c076 scsi: qla4xxx: shut up warning for rd_reg_indirect
The qla4_83xx_rd_reg_indirect() function can fail when it is unable to
read a register, but not all callers check its return value before using
the register data, and gcc correctly warns about this:

qla4xxx/ql4_83xx.c: In function 'qla4_83xx_process_reset_template':
qla4xxx/ql4_83xx.c:1073:36: warning: 'value' may be used uninitialized in this function
     ha->reset_tmplt.array[index++] = value;
                                    ^
qla4xxx/ql4_83xx.c:1050:11: note: 'value' was declared here
  uint32_t value;
           ^
qla4xxx/ql4_83xx.c:902:8: warning: 'value' may be used uninitialized in this function
  value &= p_rmw_hdr->test_mask;
        ^
qla4xxx/ql4_83xx.c:895:11: note: 'value' was declared here
  uint32_t value;
           ^
In file included from ../include/linux/io.h:25:0,
                 from ../include/linux/pci.h:31,
                 from ../drivers/scsi/qla4xxx/ql4_def.h:16,
                 from ../drivers/scsi/qla4xxx/ql4_83xx.c:10:
asm/io.h:101:2: warning: 'value' may be used uninitialized in this function
  asm volatile("str %1, %0"
  ^
qla4xxx/ql4_83xx.c:874:11: note: 'value' was declared here
  uint32_t value;
           ^

Unfortunately, I don't see any helpful way to add proper error handling
for this case, and the failure scenario for rd_reg seems rather obscure,
so this bails out and makes the rd_reg accessor set the result to
0xffffffff so we at least get a predictable value.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23 21:27:02 -05:00
..
Kconfig
Makefile
ql4_83xx.c scsi: qla4xxx: shut up warning for rd_reg_indirect 2016-02-23 21:27:02 -05:00
ql4_83xx.h qla4xxx: Added new opcodes for 84XX Minidump template 2014-05-19 19:12:13 +02:00
ql4_attr.c [SCSI] qla4xxx: Update Copyright header 2013-09-03 07:27:54 -07:00
ql4_bsg.c qla4xxx: Fix printk() in qla4_83xx_read_reset_template() and qla4_83xx_pre_loopback_config() 2015-05-26 15:22:17 +02:00
ql4_bsg.h [SCSI] qla4xxx: Added support for Diagnostics MBOX command 2013-12-19 20:56:25 -08:00
ql4_dbg.c [SCSI] qla4xxx: Added support for ISP8042 2013-09-03 07:27:53 -07:00
ql4_dbg.h
ql4_def.h qla4xxx: add a missing include 2015-05-27 14:20:40 -04:00
ql4_fw.h qla4xxx: Add support of 0xFF capture mask for minidump 2014-05-19 19:12:13 +02:00
ql4_glbl.h scsi: use 64-bit LUNs 2014-07-17 22:07:37 +02:00
ql4_init.c qla4xxx: check the return value of dma_alloc_coherent() 2014-07-30 07:49:37 -04:00
ql4_inline.h [SCSI] qla4xxx: Add support to set CHAP entries 2013-10-25 09:58:01 +01:00
ql4_iocb.c scsi: remove abuses of scsi_populate_tag 2014-11-12 11:19:41 +01:00
ql4_isr.c scsi: use 64-bit LUNs 2014-07-17 22:07:37 +02:00
ql4_mbx.c scsi: qla4xxx: ql4_mbx.c: Cleaning up missing null-terminate in conjunction with strncpy 2014-07-30 07:49:36 -04:00
ql4_nvram.c [SCSI] qla4xxx: Update Copyright header 2013-09-03 07:27:54 -07:00
ql4_nvram.h [SCSI] qla4xxx: Update Copyright header 2013-09-03 07:27:54 -07:00
ql4_nx.c move io-64-nonatomic*.h out of asm-generic 2015-10-15 00:21:07 +02:00
ql4_nx.h qla4xxx: Added new opcodes for 84XX Minidump template 2014-05-19 19:12:13 +02:00
ql4_os.c scsi: use host wide tags by default 2015-11-09 17:11:57 -08:00
ql4_version.h qla4xxx: Update driver version to 5.04.00-k6 2014-05-19 19:12:21 +02:00