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: 13097539 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DB30C54EBC for ; Thu, 12 Jan 2023 06:27:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235441AbjALG1F (ORCPT ); Thu, 12 Jan 2023 01:27:05 -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 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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,