diff mbox series

[v2] target/iscsi: fix possible condition with no effect (if == else)

Message ID 20190528012151.GA4845@hari-Inspiron-1545 (mailing list archive)
State Accepted
Commit 4cdcac040c805862f415fe99d9d290069a59c584
Headers show
Series [v2] target/iscsi: fix possible condition with no effect (if == else) | expand

Commit Message

Hariprasad Kelam May 28, 2019, 1:21 a.m. UTC
fix below warning reported by coccicheck

drivers/target/iscsi/iscsi_target_nego.c:175:6-8: WARNING: possible
condition with no effect (if == else)

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
Changes in v2: treat SRP as unsupported authtype.
               Remove unnecessary else
               return 2 in all unsupported cases

---
---
 drivers/target/iscsi/iscsi_target_nego.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

Comments

David Disseldorp May 28, 2019, 8:20 a.m. UTC | #1
On Tue, 28 May 2019 06:51:52 +0530, Hariprasad Kelam wrote:

> fix below warning reported by coccicheck
> 
> drivers/target/iscsi/iscsi_target_nego.c:175:6-8: WARNING: possible
> condition with no effect (if == else)
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> ---
> Changes in v2: treat SRP as unsupported authtype.
>                Remove unnecessary else
>                return 2 in all unsupported cases

Reviewed-by: David Disseldorp <ddiss@suse.de>

Cheers, David
Martin K. Petersen May 30, 2019, 1:41 a.m. UTC | #2
Hariprasad,

> fix below warning reported by coccicheck
>
> drivers/target/iscsi/iscsi_target_nego.c:175:6-8: WARNING: possible
> condition with no effect (if == else)

Applied to 5.3/scsi-queue, thanks!
diff mbox series

Patch

diff --git a/drivers/target/iscsi/iscsi_target_nego.c b/drivers/target/iscsi/iscsi_target_nego.c
index 8a5e8d1..92ce2fd 100644
--- a/drivers/target/iscsi/iscsi_target_nego.c
+++ b/drivers/target/iscsi/iscsi_target_nego.c
@@ -160,22 +160,11 @@  static u32 iscsi_handle_authentication(
 
 	if (strstr("None", authtype))
 		return 1;
-#ifdef CANSRP
-	else if (strstr("SRP", authtype))
-		return srp_main_loop(conn, auth, in_buf, out_buf,
-				&in_length, out_length);
-#endif
 	else if (strstr("CHAP", authtype))
 		return chap_main_loop(conn, auth, in_buf, out_buf,
 				&in_length, out_length);
-	else if (strstr("SPKM1", authtype))
-		return 2;
-	else if (strstr("SPKM2", authtype))
-		return 2;
-	else if (strstr("KRB5", authtype))
-		return 2;
-	else
-		return 2;
+	/* SRP, SPKM1, SPKM2 and KRB5 are unsupported */
+	return 2;
 }
 
 static void iscsi_remove_failed_auth_entry(struct iscsi_conn *conn)