From patchwork Fri Oct 14 08:16:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 13006769 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 36089C4332F for ; Fri, 14 Oct 2022 08:17:43 +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=bgMG6TBTqT6+C/l4OCT46zN3Q2PL5oLsK5NW41wzEt8=; b=ue3JaiN538Uiw6 76Q64z8YJVOsUA2FIuATEylrLAGiX7lMB5FUl9PwVR7Hv+vdXBvt6cOA88hI7lXoXBddH7c0WbYfg X9Row4AObanXlO6XNalZuan526SpYXBIiUohCNT3JSM+99MDavTywdZfUwA9hMMIau7MHBq/M64RD 5KMuGfygX0aSUtLS33TsLPHifmLxED3V5wLHy/ha4Hv9lZ1SSH4ekqi9ZSR1iw8PxGYDYUPvvwte/ okouAD0R/XQv7dYl2/z1FvHlaEODU4I5F+/4l1PYRejdmw5JYBQkLgxMVoilpKK7iG4PHyPtJqWjH cNkpbh5DwK7YM4yDsHww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ojFrv-00E2Xc-HL; Fri, 14 Oct 2022 08:16:35 +0000 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ojFrt-00E2Ww-H6 for linux-arm-kernel@lists.infradead.org; Fri, 14 Oct 2022 08:16:34 +0000 Received: by mail-lj1-x230.google.com with SMTP id m23so5149475lji.2 for ; Fri, 14 Oct 2022 01:16:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=edW1SZPZk5oTvbkbtASITiKdHC2vwGxOU1SxXrshM3s=; b=Y78sMr/o4YSO539vsfAdIvlQ0jd/6rPhIdLpv6YNTg0hrcITtiG9myVUl/aNFGedin 0Ra0o/d+gVFZMawqf+rVVAqKgPgbMWK6xIlCL08+Kl6XgLg94b3y9dPd5FzD5YICpb59 zP/C2eiwx8xWWGMOoUBe2l+Lg2T5HTuwStdLMVullG6pTbNbIaZcXejzFpbPn/N9NDan qQOlqCdziGe00c5UZxRU7AzsTkUeDekjFrzs+y5Wmv/tq/BdfFtkXRJW0Jg0GrHPtlT5 0Ck6rUdnnkaBNem5Rw+1pMVBU1UUAX60w4tTsT1pj9L9ZSO+d34CNihQ4oXoKa3ZiTzA pdgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=edW1SZPZk5oTvbkbtASITiKdHC2vwGxOU1SxXrshM3s=; b=y8KOk+4iKe4Q2nomXu+LnadgljLy53zZJRX0Gl9HETjKBk6P/zxojIgpzETUQPNZX4 B7eOd8g2aIJY1OqUq7vESqRGh5cSD55uxIFs+pShueKILEzMmO6StAsKLR4727ZYmFSq TXUbUhhJeW64LxyRMcyNJeAAtiUIsrP/uDSwXh5YmdAMeVCpN/zcIxAamUxaoDromRu6 Q4xuBkPVsf+0cqLvev3iVN2UGpr/P4YEo8QeCXcHXw2WXAfTV4+3AtcP3kOuB1oavh8u AC3ftfW0eN5/wasgWXqXivNu3ymsoQ07bIpoJceb8JMA3byBWmqtTzfDeizk80c/ITjd XUOw== X-Gm-Message-State: ACrzQf1qIiUbwJ0AUja9zegFUvVq5x4sv+kCtY3d2fntviLwyYe9DQcb YraH7mElWL4tMH5d27vwD/Y= X-Google-Smtp-Source: AMsMyM4naaQLAMQ8tXoTscYfLSobLQwKWzJzvDBqvWV5PXeeauDm1XtczDREsNSk5AfT1jKfT7LXxA== X-Received: by 2002:a2e:bd0c:0:b0:26d:d9fd:f61b with SMTP id n12-20020a2ebd0c000000b0026dd9fdf61bmr1434686ljq.151.1665735391141; Fri, 14 Oct 2022 01:16:31 -0700 (PDT) Received: from localhost.localdomain (82-209-154-112.cust.bredband2.com. [82.209.154.112]) by smtp.gmail.com with ESMTPSA id a9-20020a05651c030900b0026ddd41aecasm263555ljp.135.2022.10.14.01.16.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 01:16:29 -0700 (PDT) From: Marcus Folkesson To: "Rafael J . Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Anson Huang Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Marcus Folkesson Subject: [PATCH] thermal: imx8mm_thermal: use GENMASK() when appropriate Date: Fri, 14 Oct 2022 10:16:20 +0200 Message-Id: <20221014081620.1599511-1-marcus.folkesson@gmail.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221014_011633_584557_2920C7F0 X-CRM114-Status: GOOD ( 11.14 ) 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 GENMASK() is preferred to use for bitmasks. Signed-off-by: Marcus Folkesson Reviewed-by: Peng Fan --- drivers/thermal/imx8mm_thermal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c index c5cd873c6e01..74fc34b88bb0 100644 --- a/drivers/thermal/imx8mm_thermal.c +++ b/drivers/thermal/imx8mm_thermal.c @@ -23,8 +23,8 @@ #define TER_ADC_PD BIT(30) #define TER_EN BIT(31) -#define TRITSR_TEMP0_VAL_MASK 0xff -#define TRITSR_TEMP1_VAL_MASK 0xff0000 +#define TRITSR_TEMP0_VAL_MASK GENMASK(7, 0) +#define TRITSR_TEMP1_VAL_MASK GENMASK(23, 16) #define PROBE_SEL_ALL GENMASK(31, 30)