From: Alexey Dobriyan <adobriyan@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de,
linux-arch@vger.kernel.org
Subject: Re: + fls-change-parameter-to-unsigned-int.patch added to -mm tree
Date: Tue, 6 Nov 2018 20:01:49 +0300 [thread overview]
Message-ID: <20181106170149.GA12947@avx2> (raw)
In-Reply-To: <20181106154437.GF3074@bombadil.infradead.org>
On Tue, Nov 06, 2018 at 07:44:37AM -0800, Matthew Wilcox wrote:
> On Tue, Nov 06, 2018 at 06:14:44PM +0300, Alexey Dobriyan wrote:
> > On Mon, Nov 05, 2018 at 03:33:01PM -0800, akpm@linux-foundation.org wrote:
> >
> > > -static inline int fls(int x)
> > > +static inline int fls(unsigned int x)
> > > {
> > > - return fls64((unsigned int) x);
> > > + return fls64(x);
> > > }
> >
> > Should it return "unsigned"? Logically it should.
> > I remember doing this and there was some code size increase :-(
>
> Yes, it returns a number in the range [0-32], so it can absolutely
> be unsigned. I'm kind of surprised it made any difference.
>
> When you say "doing this", what did you try? unsigned fls(unsigned),
> int fls(unsigned) or unsigned fls(int) ?
I did "unsigned fls()" with and without
if (rv > 32)
__builtin_unreachable();
but I didn't send anything because there was something erratic with code
generation.
prev parent reply other threads:[~2018-11-06 17:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-05 23:33 + fls-change-parameter-to-unsigned-int.patch added to -mm tree akpm
2018-11-06 15:14 ` Alexey Dobriyan
2018-11-06 15:44 ` Matthew Wilcox
2018-11-06 17:01 ` Alexey Dobriyan [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=20181106170149.GA12947@avx2 \
--to=adobriyan@gmail.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.