From bc9a96dfebe6e067a04829b5cd7ef36064c47c95 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 20 Aug 2014 02:24:08 +0000 Subject: [PATCH] Fix Coverity warning of q2t_ctio_to_cmd() dead code Coverity warns that 'handle == Q2T_SKIP_HANDLE' can never occur, because code preceding the test has masked out a handle bit that would be required for the test to succeed. Fix that by extending Q2T_SKIP_HANDLE to incorporate CTIO_INTERMEDIATE_HANDLE_MARK as well. Reported-by: Steven J. Magnani git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5718 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla2x00-target/qla2x00t.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qla2x00t/qla2x00-target/qla2x00t.h b/qla2x00t/qla2x00-target/qla2x00t.h index 21c4632d1..d3d976478 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.h +++ b/qla2x00t/qla2x00-target/qla2x00t.h @@ -78,9 +78,13 @@ #define Q2T_STATE_PROCESSED 3 /* SCST done processing */ #define Q2T_STATE_ABORTED 4 /* Command aborted */ -/* Special handles */ +/* + * Special handles. + * !! Changing them here, make sure that mask in the beginning of + * !! q2t_ctio_to_cmd() changed accordingly! + */ #define Q2T_NULL_HANDLE 0 -#define Q2T_SKIP_HANDLE (0xFFFFFFFF & ~CTIO_COMPLETION_HANDLE_MARK) +#define Q2T_SKIP_HANDLE (0xFFFFFFFF & ~(CTIO_COMPLETION_HANDLE_MARK|CTIO_INTERMEDIATE_HANDLE_MARK)) /* ATIO task_codes field */ #define ATIO_SIMPLE_QUEUE 0