From: Sudeep Holla <sudeep.holla@arm.com>
To: Conor Dooley <conor.dooley@microchip.com>
Cc: 王明-软件底层技术部 <machel@vivo.com>,
"Sudeep Holla" <sudeep.holla@arm.com>,
"Conor Dooley" <conor@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"opensource.kernel" <opensource.kernel@vivo.com>,
"Pierre Gondois" <pierre.gondois@arm.com>
Subject: Re: 回复: [PATCH v1] drivers:base:Fix unsigned compared with less than zero
Date: Fri, 16 Jun 2023 10:00:54 +0100 [thread overview]
Message-ID: <20230616090054.b3lxtsj67oyp6s3h@bogus> (raw)
In-Reply-To: <20230615-cathedral-concur-969e91b8c792@wendy>
On Thu, Jun 15, 2023 at 07:50:45AM +0100, Conor Dooley wrote:
> Hey,
>
> For some (probably good) reason, this doesn't appear to have made it to
> the lists.
>
> On Thu, Jun 15, 2023 at 02:05:18AM +0000, 王明-软件底层技术部 wrote:
> > 发件人: Conor Dooley <conor@kernel.org>
> > > On Wed, Jun 14, 2023 at 09:35:36PM +0800, Wang Ming wrote:
> > > > The return value of the of_count_cache_leaves() is long.
> > > > However, the return value is being assigned to an unsigned long
> > > > variable 'leaves',so making 'leaves' to long.
> > >
> > > But you actually made it an int?
> > >
> > > > silence the warning:
> > > > ./drivers/base/cacheinfo.c:300:5-11: WARNING: Unsigned expression
> > > > compared with zero: leaves > 0
> > >
> > > I'm dumb, why is comparing an unsigned value with zero a problem in
> > > and of itself? Zero is a valid value for an unsigned type, no?
> > >
> > > If you actually look at the function, it only returns positive,
> > > non-zero values anyway, so returning an int is a bit pointless, as
> > > are the checks, no?
>
> > Thank you, I see. This doesn't need to be fixed.
>
> Right, but I was suggesting that you should change the function to not
> return a signed value anymore & remove the check for whether it is
> zero, instead of your patch.
>
> Cheers,
> Conor.
>
> +CC Sudeep, Pierre: FYI. Original posting is at
> https://lore.kernel.org/all/20230614133549.3774-1-machel@vivo.com/
> in case threading is broken, as I think the in-reply-to header in what
> I am replying to is corrupted.
Also if the original thread landed, I couldn't have responded because of
the disclaimer 🙁.
--
Regards,
Sudeep
prev parent reply other threads:[~2023-06-16 9:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-14 13:35 Wang Ming
2023-06-14 14:33 ` Conor Dooley
[not found] ` <SG2PR06MB374351CD57614B51FF2E71CABD5BA@SG2PR06MB3743.apcprd06.prod.outlook.com>
[not found] ` <20230615-cathedral-concur-969e91b8c792@wendy>
2023-06-16 9:00 ` Sudeep Holla [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=20230616090054.b3lxtsj67oyp6s3h@bogus \
--to=sudeep.holla@arm.com \
--cc=conor.dooley@microchip.com \
--cc=conor@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=machel@vivo.com \
--cc=opensource.kernel@vivo.com \
--cc=pierre.gondois@arm.com \
--cc=rafael@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®