patch-2.4.10 linux/net/wanrouter/wanproc.c

Next file: linux/net/x25/af_x25.c
Previous file: linux/net/unix/af_unix.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/net/wanrouter/wanproc.c linux/net/wanrouter/wanproc.c
@@ -259,7 +259,7 @@
 		pos = dent->get_info(page, dent->data, 0, 0);
 		offs = file->f_pos;
 		if (offs < pos) {
-			len = min(unsigned int, pos - offs, count);
+			len = min_t(unsigned int, pos - offs, count);
 			if (copy_to_user(buf, (page + offs), len)) {
 				kfree(page);
 				return -EFAULT;
@@ -805,7 +805,7 @@
 		pos = dent->get_info(page, dent->data, 0, 0, 0);
 		offs = file->f_pos;
 		if (offs < pos) {
-			len = min(unsigned int, pos - offs, count);
+			len = min_t(unsigned int, pos - offs, count);
 			if (copy_to_user(buf, (page + offs), len)) {
 				kfree(page);
 				return -EFAULT;
@@ -841,7 +841,7 @@
 		pos = dent->get_info(page, dent->data, 0, 0, 0);
 		offs = file->f_pos;
 		if (offs < pos) {
-			len = min(unsigned int, pos - offs, count);
+			len = min_t(unsigned int, pos - offs, count);
 			memcpy_tofs((void*)buf, (void*)(page + offs), len);
 			file->f_pos += len;
 		}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)