Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1258721 > unrolled thread

[PATCH] fs/file.c: __const_max is actually __const_min :-)

Started byRasmus Villemoes <linux@rasmusvillemoes.dk>
First post2015-10-29 12:10 +0100
Last post2015-10-29 12:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] fs/file.c: __const_max is actually __const_min :-) Rasmus Villemoes <linux@rasmusvillemoes.dk> - 2015-10-29 12:10 +0100
    Re: [PATCH] fs/file.c: __const_max is actually __const_min :-) Albino B Neto <bino@bino.us> - 2015-10-29 12:20 +0100

#1258721 — [PATCH] fs/file.c: __const_max is actually __const_min :-)

FromRasmus Villemoes <linux@rasmusvillemoes.dk>
Date2015-10-29 12:10 +0100
Subject[PATCH] fs/file.c: __const_max is actually __const_min :-)
Message-ID<qoTfH-7Sg-1@gated-at.bofh.it>
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)
-- 
2.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1258725

FromAlbino B Neto <bino@bino.us>
Date2015-10-29 12:20 +0100
Message-ID<qoTpo-7W4-9@gated-at.bofh.it>
In reply to#1258721
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 ?

     Albino
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web