Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4427089ybi; Mon, 27 May 2019 18:24:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+cec50y2Do+jy0GIOV/e2UtPaesSnBALcG0prB81bHK1gb+/qzHulBleOAdEfSQ/CXDfy X-Received: by 2002:a63:1f55:: with SMTP id q21mr68671411pgm.51.1559006657222; Mon, 27 May 2019 18:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559006657; cv=none; d=google.com; s=arc-20160816; b=DyUqomRqsER1nx0VnPJmfOnT/TZocHI67MPiZKQy3owTJyRk9AfNF99EZ2+BuPCUuu /gGCAva+59Wvl0fDFsSWW3Yo2pSIHMb8KG3bzvz0ySK0ZFGfieYFwQDs/fqjkw9sQ4br x5jNMe+pKfw/5KSidGPzpuf+gdiBPNaSZJ5RG47Gq4fau/dx+zyDx1KEfvZO1xoA8RaU HRBInc/EvhZY2JzcXXT5JNilklz4v84ebY3C/2glv7PEBXfiGnZrnljmTkQnzdyA2enr h9R7EW5lkoHRbX4G+1RZQHEUQRHK2kH32pqoq6qkLT/mzKcZYb8zH6SCJWKz58CyFGYu 64ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=WyrVEd7Z066n8x3W3p36ZvDVCldsmbGvGU0q2zkOUWY=; b=MBkmG7m2dl3PPguT0GWLs8Mzb5KkuNbFfsPbcNtTdnxj7mUt2dexZSEd49JqoVUjUR 2UQKgJWKqWaFqVEViOjrx/zkMW290N1Xn2mPvmYa10M/H0xUoh+Ta0/KkTAoMNFVRpA4 ShTQSYaIVOJu4Epo8Vh0GSz91BwhR7gsLoqFlrlqzRFH9YYJ1zQS+2+he3/pgcVA8R8q uskKW3pg3YK+BvRhXlZYkcy35dfUyj4df2s4goLAxjnRMxPWX8glRpdAsnn13o1T/LXg rJyTT9tfmXgjwdwr7AhFKXuq3qYQz+TGURjufbcv+2WhH2SIb0pfnwKeQMZYR/+ldLBf Anaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JPfj5asY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s73si21642036pfs.15.2019.05.27.18.24.01; Mon, 27 May 2019 18:24:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JPfj5asY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727783AbfE1BWA (ORCPT + 99 others); Mon, 27 May 2019 21:22:00 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:38452 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727090AbfE1BV7 (ORCPT ); Mon, 27 May 2019 21:21:59 -0400 Received: by mail-pf1-f194.google.com with SMTP id b76so10393782pfb.5; Mon, 27 May 2019 18:21:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=WyrVEd7Z066n8x3W3p36ZvDVCldsmbGvGU0q2zkOUWY=; b=JPfj5asYw7HCuZpjdcUxtFWyEFHcmHBfYWpcQ4cmCmn01QcNRXP91gGo5EDqXK0ebD yGi03pUH40J20cuiByrNO5+e2WHsEB1cGlo+knxIfa3kdjvc5aSFrbfY38H09Y9MD/XE fDpB+LX6OBDNmaFUxzMNfQaxGSJeTuLYKuaQ/ihD1gRzlWNDwA1g/GKXwk6q7q4PuWGH IZSRIHQV+dD2le7wFYYByLBYCm11oAeO5vEAM6i1GN0ndtqDz4qnifhYOMYizJ6iuJDk nRDuDJ+0zMOWpVOtpNL4NfZ+FTwbGGSld7XcgS5vRk1TkzoL7CEf3Jxz3aNdPmhCoVAS zV+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=WyrVEd7Z066n8x3W3p36ZvDVCldsmbGvGU0q2zkOUWY=; b=foZCkTpH9/ignb7hIeNbTVrINpBRNWUkLuSrzPAZwxUFv3aJip0Y/uzSlqnWpfrxvN Np27XY6lMkIOuAMMXMKmOkmXR62XibVgchSjrsf/5TlOW/GfVbm0so1zqKv8oW5eRIuW Qxsoj+XP6apVZTIH70+P44IE+AEM13fVVcegcvWlNxdFQCgRIxe5mdDPikW8ViGXa9yc A1V2v5HrDZuaOdAgONmnV47fcCYtxrGSDVtin2YhG6SNBjyIiNHKGjJSoS9anKFXuB3L TSFWJ26e2tALidB4umt4VsS4LVqXmS1egp8ZYyp6UdihdWI3Bx/AgM+iEsFJwDEnEwxF +POQ== X-Gm-Message-State: APjAAAWNsJZGizINknDxOMEtPA1wFdSUIuomkPvR9eLlB+K4RuzI/s/N qOMMHbNMdQ/G5haI6bxVFFM= X-Received: by 2002:a63:ed09:: with SMTP id d9mr12668611pgi.419.1559006518896; Mon, 27 May 2019 18:21:58 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.89.153]) by smtp.gmail.com with ESMTPSA id z125sm15537156pfb.75.2019.05.27.18.21.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 May 2019 18:21:57 -0700 (PDT) Date: Tue, 28 May 2019 06:51:52 +0530 From: Hariprasad Kelam To: ddiss@suse.de, "Martin K. Petersen" , Hariprasad Kelam , 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) Message-ID: <20190528012151.GA4845@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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