Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10556833rwl; Wed, 11 Jan 2023 22:44:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXtmo+nApD6diZRdahdESn6NkJEaCJBZjO5ioyFu/jypwpWYQGptmSYtnwDjuKQuZaOXzjOf X-Received: by 2002:a05:6402:229b:b0:499:b415:bb27 with SMTP id cw27-20020a056402229b00b00499b415bb27mr12294426edb.4.1673505863025; Wed, 11 Jan 2023 22:44:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673505863; cv=none; d=google.com; s=arc-20160816; b=qopL4gE/b81I/OSxGs9ezJHKMT5lG4/dkaYRni5NT1TxbpgYWrhW8RWi8869vIo7Tk iwWJ2Tyrep8xh7LhRdiFjV7toBILDUgu35I2qQmNr8FbWPxAZ11Ufmt1GUD1yWKXyswi IK0iSIigF58ICe36FwXQ4PRjD4lXPFFY+ZprxLvHhPV2KbbQ3Lhj5z3YAHvPxQ7MgV4c 1lBHbcmNn7j02vXaDSq+ZgH+QPQwTaAJDm6XF5AaR7I1cwtuYccvqclu+Gynry9PZ8uC uLusCZ184GgGk0ZC29qv9nfUo/slQizMmyfBtZokoAQXpGRpJqDthVnlQvzTrf+gb1BL rdHQ== 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 Return-Path: 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.44.11; Wed, 11 Jan 2023 22:44:23 -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 + 50 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-Type: text/plain; charset=us-ascii 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 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 --- 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, -- 2.34.1