]> git.hungrycats.org Git - linux/commitdiff
[PATCH] procfs: use kernel min/max
authorAndrew Morton <akpm@osdl.org>
Thu, 18 Mar 2004 23:01:35 +0000 (15:01 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 18 Mar 2004 23:01:35 +0000 (15:01 -0800)
From: "Randy.Dunlap" <rddunlap@osdl.org>

From: Michael Veeck <michael.veeck@gmx.net>

Patch (against 2.6.3) removes unnecessary min/max macros and changes calls to
use kernel.h macros instead.

fs/proc/generic.c

index 67e8f5fad93bdc3f4356860db3e905585ee92ede..27579e55ead239dce931895e9322f5659b9876a3 100644 (file)
@@ -37,10 +37,6 @@ static struct file_operations proc_file_operations = {
        .write          = proc_file_write,
 };
 
-#ifndef MIN
-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
-#endif
-
 /* buffer size is one page but our output routines use some slack for overruns */
 #define PROC_BLOCK_SIZE        (PAGE_SIZE - 1024)
 
@@ -61,7 +57,7 @@ proc_file_read(struct file *file, char __user *buf, size_t nbytes,
                return -ENOMEM;
 
        while ((nbytes > 0) && !eof) {
-               count = MIN(PROC_BLOCK_SIZE, nbytes);
+               count = min_t(ssize_t, PROC_BLOCK_SIZE, nbytes);
 
                start = NULL;
                if (dp->get_info) {