From: Stafford Horne <shorne@gmail.com>
To: David Laight <David.Laight@aculab.com>
Cc: 'Arnd Bergmann' <arnd@kernel.org>,
Michal Simek <monstr@monstr.eu>,
Christoph Hellwig <hch@infradead.org>,
Arnd Bergmann <arnd@arndb.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] microblaze: remove CONFIG_SET_FS
Date: Fri, 11 Feb 2022 07:23:42 +0900 [thread overview]
Message-ID: <YgWQbpBX6eJNozGM@antec> (raw)
In-Reply-To: <cc2a0d0eb77b4ace872263db7bf0c115@AcuMS.aculab.com>
On Thu, Feb 10, 2022 at 02:21:07PM +0000, David Laight wrote:
> From: Arnd Bergmann
> > static inline int __range_ok(unsigned long addr, unsigned long size)
> > {
> > return size <= TASK_SIZE && addr <= (TASK_SIZE - size);
> > }
> >
> > since 'size' is usually constant, so this turns into a single comparison
> > against a compile-time constant.
>
> Hmmm... maybe there should be a comment that it is the same as
> the more obvious:
> (addr <= TASK_SIZE && addr <= TASK_SIZE - size)
> but is better for constant size.
> (Provided TASK_SIZE is a constant.)
Ah, this makes sense that. I might as well revert the OpenRISC patch for this.
Though, we shall move to the generic version in the end.
With ideal compare:
-rwxrwxr-x. 1 shorne shorne 6011932 Feb 9 17:57 vmlinux
With comparing (size <= TASK_SIZE && addr <= TASK_SIZE - size):
-rwxrwxr-x. 1 shorne shorne 6003556 Feb 11 07:18 vmlinux
-Stafford
next prev parent reply other threads:[~2022-02-10 22:23 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 14:48 [PATCH] microblaze: remove CONFIG_SET_FS Arnd Bergmann
2022-02-10 9:36 ` David Laight
2022-02-10 13:29 ` Arnd Bergmann
2022-02-10 14:21 ` David Laight
2022-02-10 14:53 ` Arnd Bergmann
2022-02-10 22:23 ` Stafford Horne [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-01-17 13:24 [PATCH 03/10] exit: Move oops specific logic from do_exit into make_task_dead Arnd Bergmann
2022-01-17 13:27 ` [PATCH] microblaze: remove CONFIG_SET_FS Arnd Bergmann
2022-02-09 13:50 ` Michal Simek
2022-02-09 13:52 ` Christoph Hellwig
2022-02-09 14:03 ` Michal Simek
2022-02-09 14:40 ` Arnd Bergmann
2022-02-09 14:44 ` Michal Simek
2022-02-09 14:54 ` Arnd Bergmann
2022-02-09 23:31 ` Stafford Horne
2022-02-11 0:17 ` Stafford Horne
2022-02-11 16:59 ` Arnd Bergmann
2022-02-11 17:46 ` Linus Torvalds
2022-02-11 20:57 ` Arnd Bergmann
2022-02-11 21:10 ` Eric W. Biederman
2022-02-11 22:21 ` Stafford Horne
2022-02-14 7:41 ` Christoph Hellwig
2022-02-14 7:50 ` Christoph Hellwig
2022-02-14 16:20 ` Arnd Bergmann
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=YgWQbpBX6eJNozGM@antec \
--to=shorne@gmail.com \
--cc=David.Laight@aculab.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=monstr@monstr.eu \
/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.