From patchwork Thu Sep 21 08:52:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 13393790 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E6010E706F3 for ; Thu, 21 Sep 2023 08:53:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=wgyi83F1UMVrLd9H8rcVtt9ehZMwhgVY5/bRVHHIyZc=; b=DEhyJNTRCc7k6t clMPSWwdmmz4yN4uLlvECdGlP4HZHrHCZCUdz/XUN0LCb5FcNR4tMLmrfjMHON2JneTomL+0y29HJ 6bp3yBmMmv6WxLn6Fw/x5u2JOqbAxzVXyBZDHB7R5qlkxnRCzcIakWhN2MxhkX3Lew4j1NzVaNaF6 /bQZQV3ZRHlsZKudaAkyeeUo/95KNQrzmyg11j7v9h87glpr0oKfeJ+58VgMAB5MqB0x/T0lfvPST KEECT73rEZ/H2mTWpVfnJqlVRGSyy9a1Bg+lKNFYJ//bZXFqtNJccRQEjXJJDrkIzwtWiWZU4GUrO 0SF8CB50RsMQEqqBn9mg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qjFQs-005Wkm-1X; Thu, 21 Sep 2023 08:53:10 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qjFQp-005WjX-0e for linux-arm-kernel@lists.infradead.org; Thu, 21 Sep 2023 08:53:09 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4D827150C; Thu, 21 Sep 2023 01:53:37 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8BB833F59C; Thu, 21 Sep 2023 01:52:59 -0700 (PDT) From: Sudeep Holla To: linux-arm-kernel@lists.infradead.org Cc: Sudeep Holla , Cristian Marussi Subject: [PATCH] firmware: arm_scmi: Do not use !! on boolean when setting msg->flags Date: Thu, 21 Sep 2023 09:52:57 +0100 Message-ID: <20230921085257.3125744-1-sudeep.holla@arm.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230921_015307_302471_6AAD36A4 X-CRM114-Status: UNSURE ( 9.62 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Both pc->async_powercap_cap_set and ignore_dresp are already boolean. Use of !! on them is obviously dubious. Sparse reports: drivers/firmware/arm_scmi/powercap.c:363:17: warning: dubious: x & !y drivers/firmware/arm_scmi/powercap.c:363:17: warning: dubious: x & !y Remove the unnecessary !! and get rid of the warning. Cc: Cristian Marussi Signed-off-by: Sudeep Holla Reviewed-by: Cristian Marussi --- drivers/firmware/arm_scmi/powercap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/arm_scmi/powercap.c b/drivers/firmware/arm_scmi/powercap.c index 244929cb4f3e..cb5617443a14 100644 --- a/drivers/firmware/arm_scmi/powercap.c +++ b/drivers/firmware/arm_scmi/powercap.c @@ -360,8 +360,8 @@ static int scmi_powercap_xfer_cap_set(const struct scmi_protocol_handle *ph, msg = t->tx.buf; msg->domain = cpu_to_le32(pc->id); msg->flags = - cpu_to_le32(FIELD_PREP(CAP_SET_ASYNC, !!pc->async_powercap_cap_set) | - FIELD_PREP(CAP_SET_IGNORE_DRESP, !!ignore_dresp)); + cpu_to_le32(FIELD_PREP(CAP_SET_ASYNC, pc->async_powercap_cap_set) | + FIELD_PREP(CAP_SET_IGNORE_DRESP, ignore_dresp)); msg->value = cpu_to_le32(power_cap); if (!pc->async_powercap_cap_set || ignore_dresp) {