lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <96565d08-8d6b-4a37-8a83-90bdd53ba89a@arm.com>
Date:   Mon, 20 Nov 2023 15:24:52 +0000
From:   Lukasz Luba <lukasz.luba@....com>
To:     Mateusz Majewski <m.majewski2@...sung.com>
Cc:     Bartlomiej Zolnierkiewicz <bzolnier@...il.com>,
        linux-pm@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-samsung-soc@...r.kernel.org,
        Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        linux-kernel@...r.kernel.org, Amit Kucheria <amitk@...nel.org>,
        Zhang Rui <rui.zhang@...el.com>,
        Alim Akhtar <alim.akhtar@...sung.com>,
        Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Marek Szyprowski <m.szyprowski@...sung.com>
Subject: Re: [PATCH v5 8/9] thermal: exynos: use BIT wherever possible

Hi Mateusz,

On 11/20/23 14:50, Mateusz Majewski wrote:
> The original driver did not use that macro and it allows us to make our
> intentions slightly clearer.
> 
> Signed-off-by: Mateusz Majewski <m.majewski2@...sung.com>
> ---
>   drivers/thermal/samsung/exynos_tmu.c | 24 ++++++++++++------------
>   1 file changed, 12 insertions(+), 12 deletions(-)
> 

[snip]

> @@ -590,15 +590,15 @@ static void exynos5433_tmu_control(struct platform_device *pdev, bool on)
>   				continue;
>   
>   			interrupt_en |=
> -				(1 << (EXYNOS7_TMU_INTEN_RISE0_SHIFT + i));
> +				BIT(EXYNOS7_TMU_INTEN_RISE0_SHIFT + i);
>   		}
>   
>   		interrupt_en |=
>   			interrupt_en << EXYNOS_TMU_INTEN_FALL0_SHIFT;
>   
> -		con |= (1 << EXYNOS_TMU_CORE_EN_SHIFT);
> +		con |= BIT(EXYNOS_TMU_CORE_EN_SHIFT);
>   	} else

Minor issue: the if-else segment here. When the 'if' has the
brackets, then the 'else' should have them as well,
even if there is only a single line under 'else'.
It's not strictly to this patch, but you can address that
later somewhere (just saw it here).

> -		con &= ~(1 << EXYNOS_TMU_CORE_EN_SHIFT);
> +		con &= ~BIT(EXYNOS_TMU_CORE_EN_SHIFT);
>   
>   	pd_det_en = on ? EXYNOS5433_PD_DET_EN : 0;
>   
> @@ -622,17 +622,17 @@ static void exynos7_tmu_control(struct platform_device *pdev, bool on)
>   				continue;
>   
>   			interrupt_en |=
> -				(1 << (EXYNOS7_TMU_INTEN_RISE0_SHIFT + i));
> +				BIT(EXYNOS7_TMU_INTEN_RISE0_SHIFT + i);
>   		}
>   
>   		interrupt_en |=
>   			interrupt_en << EXYNOS_TMU_INTEN_FALL0_SHIFT;
>   
> -		con |= (1 << EXYNOS_TMU_CORE_EN_SHIFT);
> -		con |= (1 << EXYNOS7_PD_DET_EN_SHIFT);
> +		con |= BIT(EXYNOS_TMU_CORE_EN_SHIFT);
> +		con |= BIT(EXYNOS7_PD_DET_EN_SHIFT);
>   	} else {
> -		con &= ~(1 << EXYNOS_TMU_CORE_EN_SHIFT);
> -		con &= ~(1 << EXYNOS7_PD_DET_EN_SHIFT);
> +		con &= ~BIT(EXYNOS_TMU_CORE_EN_SHIFT);
> +		con &= ~BIT(EXYNOS7_PD_DET_EN_SHIFT);
>   	}
>   
>   	writel(interrupt_en, data->base + EXYNOS7_TMU_REG_INTEN);


The patch LGTM,

Reviewed-by Lukasz Luba <lukasz.luba@....com>

Regards,
Lukasz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ