From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754849AbbKWVhb (ORCPT ); Mon, 23 Nov 2015 16:37:31 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:36182 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753322AbbKWVh1 (ORCPT ); Mon, 23 Nov 2015 16:37:27 -0500 From: Rasmus Villemoes To: Albino B Neto Cc: Alexander Viro , linux-fsdevel , LKML Subject: Re: [PATCH] fs/file.c: __const_max is actually __const_min :-) Organization: D03 References: <1446116501-25512-1-git-send-email-linux@rasmusvillemoes.dk> X-Hashcash: 1:20:151123:viro@zeniv.linux.org.uk::SzbgvEjcW8zuTNf0:000000000000000000000000000000000000000A3M X-Hashcash: 1:20:151123:linux-kernel@vger.kernel.org::gpoUHdJJvP9K9EPH:0000000000000000000000000000000003dVl X-Hashcash: 1:20:151123:bino@bino.us::9iEE0mn7VxgUttPW:000004Kmj X-Hashcash: 1:20:151123:linux-fsdevel@vger.kernel.org::c1Gi+xqYlPiQlkda:0000000000000000000000000000000069Qc Date: Mon, 23 Nov 2015 22:37:23 +0100 In-Reply-To: (Albino B. Neto's message of "Thu, 29 Oct 2015 09:18:45 -0200") Message-ID: <877fl8xur0.fsf@rasmusvillemoes.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 29 2015, Albino B Neto wrote: > 2015-10-29 9:01 GMT-02:00 Rasmus Villemoes : >> 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 >> --- >> 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?