From: David Laight <David.Laight@ACULAB.COM>
To: 'Dan Carpenter' <dan.carpenter@oracle.com>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: 'Jiapeng Chong' <jiapeng.chong@linux.alibaba.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"linux-staging@lists.linux.dev" <linux-staging@lists.linux.dev>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Abaci Robot <abaci@linux.alibaba.com>
Subject: RE: [PATCH] staging: pi433: using div64_u64() instead of do_div()
Date: Thu, 10 Feb 2022 09:21:08 +0000 [thread overview]
Message-ID: <eefeb019b58e4b1a814462c709d224b6@AcuMS.aculab.com> (raw)
In-Reply-To: <20220210080603.GJ1951@kadam>
From: Dan Carpenter
> Sent: 10 February 2022 08:06
>
> On Wed, Feb 09, 2022 at 08:15:13PM +0100, Christophe JAILLET wrote:
> > Le 21/01/2022 à 14:34, David Laight a écrit :
> > > From: Jiapeng Chong
> > > > Sent: 21 January 2022 11:50
> > > > Subject: [PATCH] staging: pi433: using div64_u64() instead of do_div()
> > > >
> > > > Clean the following coccicheck warning:
> > > >
> > > > ./drivers/staging/pi433/rf69.c:286:1-7: WARNING: do_div() does a
> > > > 64-by-32 division, please consider using div64_u64 instead.
> > >
> > > That is one of patchcheck's worse warnings.
> > >
> > > You need to check the domain of the divisor, not its type.
> > >
> > > do_div() exists to avoid expensive 64bit divides when the
> > > divisor is small.
> > >
> > > David
> > >
> > > -
> > > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> > > Registration No: 1397386 (Wales)
> > >
> > >
> >
> > Moreover, the patch is broken by itself.
> >
> > See [1] were it was already reported that do_div() and div64_u64() don't
> > have the same calling convention.
> >
> > Looks that div64_u64() and div64_ul() works the same way.
>
> We could mark those as __must_check functions.
That, and some kind of AI system to filter out untested patches
from (presumably) students who think that the output from these
tools 'must be right'.
Same for all the patches for using swap(), min() LIST_HEAD() etc.
They are at best churn and make the code harder to read.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2022-02-10 9:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-21 11:49 Jiapeng Chong
2022-01-21 13:34 ` David Laight
2022-02-09 19:15 ` Christophe JAILLET
2022-02-10 8:06 ` Dan Carpenter
2022-02-10 9:21 ` David Laight [this message]
2022-02-10 10:42 ` Dan Carpenter
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=eefeb019b58e4b1a814462c709d224b6@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=abaci@linux.alibaba.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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®