From: Alexey Dobriyan <adobriyan@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, mm-commits@vger.kernel.org,
akpm@linux-foundation.org
Subject: Re: + fix-mult_frac-multiple-argument-evaluation-bug.patch added to mm-nonmm-unstable branch
Date: Tue, 23 May 2023 11:48:23 +0300 [thread overview]
Message-ID: <6e6b2dc1-1fab-4506-bbad-41edaafd7231@p183> (raw)
In-Reply-To: <87ttw4udzv.ffs@tglx>
On Tue, May 23, 2023 at 01:45:40AM +0200, Thomas Gleixner wrote:
> On Mon, May 22 2023 at 14:15, Andrew Morton wrote:
> > ------------------------------------------------------
> > From: Alexey Dobriyan <adobriyan@gmail.com>
> > Subject: include/linux/math.h: fix mult_frac() multiple argument evaluation bug
> > Date: Sat, 20 May 2023 21:25:19 +0300
> >
> > mult_frac() evaluates _all_ arguments multiple times in the body.
>
> I'm not opposed to the patch, but to the description.
>
> Multiple evaluation is not a bug per se.
It is kind of a bug if a macro pretends to be a function and is spelled in
lowercase.
> Unless there is a reasonable explanation for the alleged bug this is
> just a cosmetic exercise.
Most usages looks OK, and compiler tend to merge loads so even more
usages are OK. But formally this is not OK:
static inline unsigned long vfs_pressure_ratio(unsigned long val)
{
return mult_frac(val, sysctl_vfs_cache_pressure, 100);
}
> Changelogs have to be self explanatory and if the shortlog, aka
> $subject, claims "bug" then there has to be a reasonable explanation
> what the actual bug is.
>
> Seriously.
>
> All this is documented, but obviously documention for changelogs and the
> acceptance of patches is just there to be ignored, right?
I don't want to return to kindergarten and document problem which every
C programmer learns exploring MIN(a, b).
next prev parent reply other threads:[~2023-05-23 8:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230522211514.E0037C4339C@smtp.kernel.org>
2023-05-22 23:45 ` Thomas Gleixner
2023-05-23 8:48 ` Alexey Dobriyan [this message]
2023-05-23 10:41 ` Thomas Gleixner
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=6e6b2dc1-1fab-4506-bbad-41edaafd7231@p183 \
--to=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=tglx@linutronix.de \
/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®