diff mbox series

thermal: imx8mm_thermal: use GENMASK() when appropriate

Message ID 20221014081620.1599511-1-marcus.folkesson@gmail.com
State Accepted
Commit 1f455f144fb05e53ae47f84eb109a8021fe168d1
Headers show
Series thermal: imx8mm_thermal: use GENMASK() when appropriate | expand

Commit Message

Marcus Folkesson Oct. 14, 2022, 8:16 a.m. UTC
GENMASK() is preferred to use for bitmasks.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
 drivers/thermal/imx8mm_thermal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Peng Fan (OSS) Oct. 17, 2022, 8:04 a.m. UTC | #1
On 10/14/2022 4:16 PM, Marcus Folkesson wrote:
> GENMASK() is preferred to use for bitmasks.
> 
> Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
> ---
>   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)
>   
Reviewed-by: Peng Fan <peng.fan@nxp.com>
diff mbox series

Patch

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)