From patchwork Thu Jan 12 06:26:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 42260 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3727846wrt; Wed, 11 Jan 2023 22:43:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXuacb9h8q/G7y76ILi6lFNJVdQBGQspZWbWMR2n1dWHptOZmj0kFWBw7trPclRCNExmQ1ZP X-Received: by 2002:a17:907:c386:b0:7c1:31b:2181 with SMTP id tm6-20020a170907c38600b007c1031b2181mr65671499ejc.19.1673505794685; Wed, 11 Jan 2023 22:43:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673505794; cv=none; d=google.com; s=arc-20160816; b=WanD/4MFnnihbvtcQ9aQrsVC49E2ruc/11GCpGjNBp3qFru7WW8N+MXP8UfanwjTbQ QJ5Jgan7Jfb4GI0WSahrksJU3pfLp4HrNDc5QNb2jPXxpvNjXGjIqgweqXCukUv/isZO yz00u3XMLSXJ8DPNBBjmQiUcHpssK//R4R7WkJNdq4OeL3oN3Sf4Xy1NM73haG2nqFf/ TrQrHnER6gyvtSHSC3Lzi11QSuKDjrTXUGKVgLZZnXRGprlx6pdqqyX3gWsBLA3v4Kf8 27NB8ccz1A+7fUw2uty7++4MbmB9JRqApKg8Oa+rG/+75h6C4EQUbnwbpbE6ss/jJhxx m9Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=HiHA/sOs8qCmqAwI8c7Wnj6/jWv+NmnwOTOAES4PQ2g=; b=LEi12KKH1USWVtS9EPtBHIno+cnIsiYJnP8Gs+mGbbTIq5yBLS+mgOjNZs2SX4N0fU YCh4fOrR1hBRxEQBm6CFJedjYO1rc31KBu4NXIGiDJkQOrneXSCoz+7aSnwqMaZ0ss7E eNQNDV7kLdAxvaIr5Lf3vpYSG6BcrNzDEJqjwiHWe/riS3fl8iuqKECZ4IVB5SrPF+Ww ONOHvSO22Sm89pwTdXwTQRW5vvSZQueOblfHoVIEwS3VLCQeI+6/aRPcsHFT+N/Mqh8j lplB317jdSanXX7aoW6UBE05meWAAS09iMhOoFOEpnoqYllZHXdjdqdFBRZ7FfbY0zOU G04w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=NDny7k1U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wt2-20020a170906ee8200b0084d3a7b6a04si13578763ejb.576.2023.01.11.22.42.45; Wed, 11 Jan 2023 22:43:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=NDny7k1U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235811AbjALG1H (ORCPT + 99 others); Thu, 12 Jan 2023 01:27:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235142AbjALG1D (ORCPT ); Thu, 12 Jan 2023 01:27:03 -0500 Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CEB93AB0A; Wed, 11 Jan 2023 22:27:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1673504810; bh=fHGz+mVERPlEDyQi1LBbBnlU4At61b0q89t6mvAZBUk=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=NDny7k1Ubmb9flzoCwIufQVhZk3lV9o2u2FHtiKJXF3vXQbolVWuP9CNzbzVJT/vP EUYR9ztfPDWnxGjF3MUJY5ra1v7sQqGrVUrk1CxObWBMnKPsfWDw1lRBVe2cNtMXHc io+RaYLitQBtGV2/vKC7GGCEthah73fxZy6cvbDs= Received: by b-3.in.mailobj.net [192.168.90.13] with ESMTP via ip-206.mailobj.net [213.182.55.206] Thu, 12 Jan 2023 07:26:50 +0100 (CET) X-EA-Auth: IlPXWbvs9jiSH8qL4yNDve1rZSPMI0a8fDcySvxCyLG/tzazJPATIVc+FBXbKDkNGzVg4i2VwN8W33u6kEcAd9zidFRmWkqr Date: Thu, 12 Jan 2023 11:56:46 +0530 From: Deepak R Varma To: Nilesh Javali , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar , Praveen Kumar Subject: [PATCH v2] scsi: qla2xxx: Simplify if condition evaluation Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754754723890652033?= X-GMAIL-MSGID: =?utf-8?q?1754798012194918227?= A logical evaluation of type (!A || A && B) can be simplified as (!A || B). Improvement by suggested by excluded_middle.cocci Coccinelel semantic patch. Signed-off-by: Deepak R Varma Reviewed-by: Himanshu Madhani > --- Please note: Change is compile tested only. Changes in v2: - Correct the if evaluation from (A && B) to (!A || B). Feedback from Lee Duncan drivers/scsi/qla2xxx/qla_target.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 548f22705ddc..4f104fbfe55d 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -1028,8 +1028,7 @@ void qlt_free_session_done(struct work_struct *work) } if (ha->flags.edif_enabled && - (!own || (own && - own->iocb.u.isp24.status_subcode == ELS_PLOGI))) { + (!own || own->iocb.u.isp24.status_subcode == ELS_PLOGI)) { sess->edif.authok = 0; if (!ha->flags.host_shutting_down) { ql_dbg(ql_dbg_edif, vha, 0x911e,