From: Hariprasad Kelam <hariprasad.kelam@gmail.com> To: ddiss@suse.de, "Martin K. Petersen" <martin.petersen@oracle.com>, Hariprasad Kelam <hariprasad.kelam@gmail.com>, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [Patch v2] target/iscsi: fix possible condition with no effect (if == else) Date: Tue, 28 May 2019 06:51:52 +0530 [thread overview] Message-ID: <20190528012151.GA4845@hari-Inspiron-1545> (raw) 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(-) 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) -- 2.7.4
WARNING: multiple messages have this Message-ID (diff)
From: Hariprasad Kelam <hariprasad.kelam@gmail.com> To: ddiss@suse.de, "Martin K. Petersen" <martin.petersen@oracle.com>, Hariprasad Kelam <hariprasad.kelam@gmail.com>, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [Patch v2] target/iscsi: fix possible condition with no effect (if == else) Date: Tue, 28 May 2019 01:33:52 +0000 [thread overview] Message-ID: <20190528012151.GA4845@hari-Inspiron-1545> (raw) 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(-) 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) -- 2.7.4
next reply other threads:[~2019-05-28 1:22 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-05-28 1:21 Hariprasad Kelam [this message] 2019-05-28 1:33 ` [Patch v2] target/iscsi: fix possible condition with no effect (if == else) Hariprasad Kelam 2019-05-28 8:20 ` David Disseldorp 2019-05-30 1:41 ` Martin K. Petersen 2019-05-30 1:41 ` Martin K. Petersen
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190528012151.GA4845@hari-Inspiron-1545 \ --to=hariprasad.kelam@gmail.com \ --cc=ddiss@suse.de \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-scsi@vger.kernel.org \ --cc=martin.petersen@oracle.com \ --cc=target-devel@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.