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] [day] [month] [year] [list]
Message-ID: <0a031f87-ba9a-120f-6331-a15872e23e73@linaro.org>
Date:   Mon, 15 May 2023 12:04:22 +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 15.05.2023 12:03, Krzysztof Kozlowski wrote:
> 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@...aro.org>
>>> ---
>> 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?
I'd say that's just a direct natural-to-computer-language translation of
"above version 3.0", but yeah it does not really make sense to check
for negative versions..

Konrad
> 
> Best regards,
> Krzysztof
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ