[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c6bcbf6b-2fa0-a6bb-a44c-6b0bd84e194f@linaro.org>
Date: Mon, 15 May 2023 11:36:12 +0200
From: Konrad Dybcio <konrad.dybcio@...aro.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] soc: qcom: rpmh-rsc: drop redundant unsigned >=0
comparision
On 13.05.2023 13:29, Krzysztof Kozlowski wrote:
> Unsigned int "minor" is always >= 0 as reported by Smatch:
>
> drivers/soc/qcom/rpmh-rsc.c:1076 rpmh_rsc_probe() warn: always true condition '(drv->ver.minor >= 0) => (0-u32max >= 0)'
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
> ---
I can see how it made sense from a human POV, but then it still
does with the right hand side removed..
Reviewed-by: Konrad Dybcio <konrad.dybcio@...aro.org>
Konrad
> drivers/soc/qcom/rpmh-rsc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
> index f93544f6d796..0dd4363ebac8 100644
> --- a/drivers/soc/qcom/rpmh-rsc.c
> +++ b/drivers/soc/qcom/rpmh-rsc.c
> @@ -1073,7 +1073,7 @@ static int rpmh_rsc_probe(struct platform_device *pdev)
> drv->ver.minor = rsc_id & (MINOR_VER_MASK << MINOR_VER_SHIFT);
> drv->ver.minor >>= MINOR_VER_SHIFT;
>
> - if (drv->ver.major == 3 && drv->ver.minor >= 0)
> + if (drv->ver.major == 3)
> drv->regs = rpmh_rsc_reg_offset_ver_3_0;
> else
> drv->regs = rpmh_rsc_reg_offset_ver_2_7;
Powered by blists - more mailing lists