linux/drivers/scsi/qla2xxx
Arnd Bergmann bc7095a926 qla2xxx: avoid maybe_uninitialized warning
The qlt_check_reserve_free_req() function produces an incorrect warning
when CONFIG_PROFILE_ANNOTATED_BRANCHES is set:

drivers/scsi/qla2xxx/qla_target.c: In function 'qlt_check_reserve_free_req':
drivers/scsi/qla2xxx/qla_target.c:1887:3: error: 'cnt_in' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   ql_dbg(ql_dbg_io, vha, 0x305a,
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       "qla_target(%d): There is no room in the request ring: vha->req->ring_index=%d, vha->req->cnt=%d, req_cnt=%d Req-out=%d Req-in=%d Req-Length=%d\n",
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       vha->vp_idx, vha->req->ring_index,
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       vha->req->cnt, req_cnt, cnt, cnt_in, vha->req->length);
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/qla2xxx/qla_target.c:1887:3: error: 'cnt' may be used uninitialized in this function [-Werror=maybe-uninitialized]

The problem is that gcc fails to track the state of the condition across
an annotated branch.

This slightly rearranges the code to move the second if() block
into the first one, to avoid the warning while retaining the
behavior of the code.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-By: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-03-18 15:25:07 -04:00
..
Kconfig qla2xxx: Remove unavailable firmware files 2015-11-18 12:03:29 -05:00
Makefile [SCSI] qla2xxx: Add support for ISP2071. 2014-03-15 10:18:50 -07:00
qla_attr.c qla2xxx: Avoid side effects when using endianizer macros. 2016-02-23 21:27:02 -05:00
qla_bsg.c qla2xxx: Provide mbx info in BBCR data after mbx failure 2016-02-23 21:27:02 -05:00
qla_bsg.h qla2xxx: Provide mbx info in BBCR data after mbx failure 2016-02-23 21:27:02 -05:00
qla_dbg.c qla2xxx: Avoid side effects when using endianizer macros. 2016-02-23 21:27:02 -05:00
qla_dbg.h qla2xxx: Change copyright year to 2014 in all the source files. 2014-05-19 13:31:02 +02:00
qla_def.h qla2xxx: Add support for Private link statistics counters. 2016-02-23 21:27:02 -05:00
qla_devtbl.h
qla_dfs.c qla2xxx: Add FW resource count in DebugFS. 2016-01-07 13:57:42 -08:00
qla_fw.h qla2xxx: Add support for buffer to buffer credit value for ISP27XX. 2016-02-23 21:27:02 -05:00
qla_gbl.h qla2xxx: Add support for online flash update for ISP27XX. 2016-02-23 21:27:02 -05:00
qla_gs.c qla2xxx: Remove __constant_ prefix 2015-08-26 10:40:32 -07:00
qla_init.c qla2xxx: Set relogin flag when we fail to queue login requests. 2016-02-23 21:27:02 -05:00
qla_inline.h qla2xxx: Avoid side effects when using endianizer macros. 2016-02-23 21:27:02 -05:00
qla_iocb.c qla2xxx: Added interface to send explicit LOGO. 2016-01-07 13:57:43 -08:00
qla_isr.c qla2xxx: Remove unneeded link offline message. 2016-02-23 21:27:02 -05:00
qla_mbx.c qla2xxx: Avoid side effects when using endianizer macros. 2016-02-23 21:27:02 -05:00
qla_mid.c qla2xxx: Fix stale pointer access. 2016-02-06 19:44:30 -08:00
qla_mr.c qla2xxx: Fix sparse annotations 2015-08-26 10:42:25 -07:00
qla_mr.h qla2xxx: Adjust adapter reset routine to the changes in firmware specification for ISPFx00. 2014-05-19 13:31:03 +02:00
qla_nx2.c qla2xxx: Replace two macros with an inline function 2015-08-26 10:35:35 -07:00
qla_nx2.h qla2xxx: Replace two macros with an inline function 2015-08-26 10:35:35 -07:00
qla_nx.c qla2xxx: Fix rwlock recursion 2015-11-17 18:21:22 -05:00
qla_nx.h qla2xxx: Change copyright year to 2014 in all the source files. 2014-05-19 13:31:02 +02:00
qla_os.c qla2xxx: Enable T10-DIF for ISP27XX 2016-02-23 21:27:02 -05:00
qla_settings.h qla2xxx: Change copyright year to 2014 in all the source files. 2014-05-19 13:31:02 +02:00
qla_sup.c qla2xxx: Avoid side effects when using endianizer macros. 2016-02-23 21:27:02 -05:00
qla_target.c qla2xxx: avoid maybe_uninitialized warning 2016-03-18 15:25:07 -04:00
qla_target.h qla2xxx: Fix TMR ABORT interaction issue between qla2xxx and TCM 2016-01-29 19:30:00 -08:00
qla_tmpl.c qla2xxx: Fix stale pointer access. 2016-02-06 19:44:30 -08:00
qla_tmpl.h qla2xxx: ISP27xx fwdump template error print simplification. 2014-09-25 14:25:02 +02:00
qla_version.h qla2xxx: Update driver version to 8.07.00.33-k 2016-02-23 21:27:02 -05:00
tcm_qla2xxx.c qla2xxx: use TARGET_SCF_USE_CPUID flag to indiate CPU Affinity 2016-02-10 23:09:00 -08:00
tcm_qla2xxx.h target: move transport ID handling to the core 2015-05-30 22:42:30 -07:00