mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] soc: qcom: rpmh-rsc: drop redundant unsigned >=0 comparision
Date: Mon, 15 May 2023 12:04:22 +0200	[thread overview]
Message-ID: <0a031f87-ba9a-120f-6331-a15872e23e73@linaro.org> (raw)
In-Reply-To: <df82a955-9de9-5c53-fe59-059273ced83d@linaro.org>



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@linaro.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
> 

      reply	other threads:[~2023-05-15 10:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-13 11:29 Krzysztof Kozlowski
2023-05-15  3:33 ` Bjorn Andersson
2023-05-15  9:36 ` Konrad Dybcio
2023-05-15 10:03   ` Krzysztof Kozlowski
2023-05-15 10:04     ` Konrad Dybcio [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0a031f87-ba9a-120f-6331-a15872e23e73@linaro.org \
    --to=konrad.dybcio@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®