mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Albino B Neto <bino@bino.us>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fs/file.c: __const_max is actually __const_min :-)
Date: Mon, 23 Nov 2015 22:37:23 +0100	[thread overview]
Message-ID: <877fl8xur0.fsf@rasmusvillemoes.dk> (raw)
In-Reply-To: <CAMu38xKcwOccuToPGf1L1uc9s7F7_SzUi6+F2noeqMWgzsjrOQ@mail.gmail.com> (Albino B. Neto's message of "Thu, 29 Oct 2015 09:18:45 -0200")

On Thu, Oct 29 2015, Albino B Neto <bino@bino.us> wrote:

> 2015-10-29 9:01 GMT-02:00 Rasmus Villemoes <linux@rasmusvillemoes.dk>:
>> 7f4b36f9bb930 "get rid of files_defer_init()" inexplicably changed a
>> min() to a __const_max() - but the __const_max macro actually gives
>> the minimum... So no functional change, just less confusing naming.
>>
>> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
>> ---
>>  fs/file.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/fs/file.c b/fs/file.c
>> index 6c672ad329e9..b2d74f6001eb 100644
>> --- a/fs/file.c
>> +++ b/fs/file.c
>> @@ -25,9 +25,9 @@
>>
>>  int sysctl_nr_open __read_mostly = 1024*1024;
>>  int sysctl_nr_open_min = BITS_PER_LONG;
>> -/* our max() is unusable in constant expressions ;-/ */
>> -#define __const_max(x, y) ((x) < (y) ? (x) : (y))
>> -int sysctl_nr_open_max = __const_max(INT_MAX, ~(size_t)0/sizeof(void *)) &
>> +/* our min() is unusable in constant expressions ;-/ */
>> +#define __const_min(x, y) ((x) < (y) ? (x) : (y))
>> +int sysctl_nr_open_max = __const_min(INT_MAX, ~(size_t)0/sizeof(void *)) &
>>                          -BITS_PER_LONG;
>>
>>  static void *alloc_fdmem(size_t size)
>
> Confused code or no ?

The code is fine, the macro name sucks. Al, ping?

      reply	other threads:[~2015-11-23 21:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 11:01 Rasmus Villemoes
2015-10-29 11:18 ` Albino B Neto
2015-11-23 21:37   ` Rasmus Villemoes [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=877fl8xur0.fsf@rasmusvillemoes.dk \
    --to=linux@rasmusvillemoes.dk \
    --cc=bino@bino.us \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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®