Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1027435pxb; Wed, 6 Apr 2022 07:03:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyt2yM8f4sm2s24daXq0MHNB1HHHaXjoKZO1Sad0LJ01U7F7wtD+POxosDMdshETc7ITI39 X-Received: by 2002:a9d:6393:0:b0:5b2:3ff9:d1c1 with SMTP id w19-20020a9d6393000000b005b23ff9d1c1mr3008316otk.243.1649253826617; Wed, 06 Apr 2022 07:03:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649253826; cv=none; d=google.com; s=arc-20160816; b=n+4B2B9obGki7ErZHVCVvjZKHS8afOJBxYUrQHvDDlKUobw+RFxsvlcLp0mX6QaFj+ RpfF4bKEu6u/+NwLHdueiLBHpKpAS754GepUMhtcGKbBNaY1aho0HpHBD74ijuKhJuu8 iqujI7hg8ElklMawzDFCKXqLo5KYNJiK+ZJ5SkptGi8cxLTzbGMFVjxqfeQ2O4HfJUZr 1dfRQ7dgf5V2waZubFZxAew46i+2hDCWbh2z4he42G6gW4TeqNIkYTljt/wiwg0Zhpa9 2sai4S+FitD2fd8p9CPYhrSbkZRtOyrrwoloBcB2zC8vYEvywqSLu6/QOaRlFKn3ZTxh qaqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=kYX4FZnsw81tN/X0sTqU3de231tg3OQvq+gCwY5pbP0=; b=RzWOWeZmJVmCygWtDWrCeuwm4P3bfwl1soppkMLXB4oQlKXZtijgCB2nlD1K9RRm9r Jbb21QgJw4wO/GJvPVFK9eDnOdw36dVEkYoyVXsD2pNJfVW46sQwUXNyzJvvmdABGEFr ypPQoMjiUBD1wc5/RbMuOsr3J1y1aBbIIZYLwVyG4gLYkwM3LyZr73VexXs82sROGh94 KPdKizCgbsi7Q6qvQ1CpD9Lkr+1JKnhBedkyaagAZijIgiQtNSo1hI/Uy97rmtf6ZiEA MIIFv/QmL87ypgYEPArHl/UGRja3FDgeieYDUBu2IRvhNEOmri64oBSCyeLnKavXRL4m J0JA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x26-20020a056870a79a00b000da716e62absi8148891oao.308.2022.04.06.07.03.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 07:03:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 552B25A1CBC; Wed, 6 Apr 2022 04:53:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242159AbiDFIfY (ORCPT + 99 others); Wed, 6 Apr 2022 04:35:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349697AbiDFIco (ORCPT ); Wed, 6 Apr 2022 04:32:44 -0400 Received: from mail.meizu.com (edge05.meizu.com [157.122.146.251]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F474187BA3; Tue, 5 Apr 2022 19:37:40 -0700 (PDT) Received: from IT-EXMB-1-125.meizu.com (172.16.1.125) by mz-mail12.meizu.com (172.16.1.108) with Microsoft SMTP Server (TLS) id 14.3.487.0; Wed, 6 Apr 2022 10:37:38 +0800 Received: from meizu.meizu.com (172.16.137.70) by IT-EXMB-1-125.meizu.com (172.16.1.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Wed, 6 Apr 2022 10:37:37 +0800 From: Haowen Bai To: Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle CC: Haowen Bai , , Subject: [PATCH V2] s390: Simplify the calculation of variables Date: Wed, 6 Apr 2022 10:37:31 +0800 Message-ID: <1649212651-32038-1-git-send-email-baihaowen@meizu.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.16.137.70] X-ClientProxiedBy: IT-EXMB-1-126.meizu.com (172.16.1.126) To IT-EXMB-1-125.meizu.com (172.16.1.125) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Fix the following coccicheck warnings: ./arch/s390/include/asm/scsw.h:695:47-49: WARNING !A || A && B is equivalent to !A || B I apply a readable version just to get rid of a warning. Signed-off-by: Haowen Bai --- V1->V2: apply a readable and simple version as suggestion. arch/s390/include/asm/scsw.h | 47 ++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/arch/s390/include/asm/scsw.h b/arch/s390/include/asm/scsw.h index a7c3ccf681da..b7e65f96de3c 100644 --- a/arch/s390/include/asm/scsw.h +++ b/arch/s390/include/asm/scsw.h @@ -508,9 +508,13 @@ static inline int scsw_cmd_is_valid_zcc(union scsw *scsw) */ static inline int scsw_cmd_is_valid_ectl(union scsw *scsw) { - return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) && - !(scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS) && - (scsw->cmd.stctl & SCSW_STCTL_ALERT_STATUS); + if (!(scsw->tm.stctl & SCSW_STCTL_STATUS_PEND)) + return 0; + if (scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) + return 0; + if (scsw->tm.stctl & SCSW_STCTL_ALERT_STATUS) + return 1; + return 0; } /** @@ -522,10 +526,15 @@ static inline int scsw_cmd_is_valid_ectl(union scsw *scsw) */ static inline int scsw_cmd_is_valid_pno(union scsw *scsw) { - return (scsw->cmd.fctl != 0) && - (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) && - (!(scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS) || - (scsw->cmd.actl & SCSW_ACTL_SUSPENDED)); + if (!scsw->tm.fctl) + return 0; + if (!(scsw->tm.stctl & SCSW_STCTL_STATUS_PEND)) + return 0; + if (!(scsw->tm.stctl & SCSW_STCTL_INTER_STATUS)) + return 1; + if (scsw->tm.actl & SCSW_ACTL_SUSPENDED) + return 1; + return 0; } /** @@ -675,9 +684,13 @@ static inline int scsw_tm_is_valid_q(union scsw *scsw) */ static inline int scsw_tm_is_valid_ectl(union scsw *scsw) { - return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) && - !(scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) && - (scsw->tm.stctl & SCSW_STCTL_ALERT_STATUS); + if (!(scsw->tm.stctl & SCSW_STCTL_STATUS_PEND)) + return 0; + if (scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) + return 0; + if (scsw->tm.stctl & SCSW_STCTL_ALERT_STATUS) + return 1; + return 0; } /** @@ -689,11 +702,15 @@ static inline int scsw_tm_is_valid_ectl(union scsw *scsw) */ static inline int scsw_tm_is_valid_pno(union scsw *scsw) { - return (scsw->tm.fctl != 0) && - (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) && - (!(scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) || - ((scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) && - (scsw->tm.actl & SCSW_ACTL_SUSPENDED))); + if (!scsw->tm.fctl) + return 0; + if (!(scsw->tm.stctl & SCSW_STCTL_STATUS_PEND)) + return 0; + if (!(scsw->tm.stctl & SCSW_STCTL_INTER_STATUS)) + return 1; + if (scsw->tm.actl & SCSW_ACTL_SUSPENDED) + return 1; + return 0; } /** -- 2.7.4