Re: [PATCH] soc: qcom: rpmh-rsc: drop redundant unsigned >=0 comparision

From: Krzysztof Kozlowski
Date: Mon May 15 2023 - 06:04:08 EST


On 15/05/2023 11:36, Konrad Dybcio wrote:
>
>
> 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@xxxxxxxxxx>
>> ---
> I can see how it made sense from a human POV, but then it still
> does with the right hand side removed..

I would argue that for human it does not make sense. Why checking minor
for >=0? Even if minor ver could be negative (error case?), what would
that mean in that context? major ver == 3 but minor == ERRNO, so we will
have drv->regs == 2.7?

Best regards,
Krzysztof