patch-2.4.9 linux/fs/romfs/inode.c

Next file: linux/fs/select.c
Previous file: linux/fs/readdir.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.8/linux/fs/romfs/inode.c linux/fs/romfs/inode.c
@@ -76,11 +76,6 @@
 
 #include <asm/uaccess.h>
 
-static int inline min(int a, int b)
-{
-	return a<b ? a : b;
-}
-
 static __s32
 romfs_checksum(void *data, int size)
 {
@@ -129,7 +124,7 @@
 				"%s.\n", kdevname(dev));
 		goto out;
 	}
-	if (romfs_checksum(rsb, min(sz,512))) {
+	if (romfs_checksum(rsb, min(int, sz, 512))) {
 		printk ("romfs: bad initial checksum on dev "
 			"%s.\n", kdevname(dev));
 		goto out;
@@ -198,7 +193,7 @@
 		return -1;		/* error */
 
 	avail = ROMBSIZE - (offset & ROMBMASK);
-	maxsize = min(count, avail);
+	maxsize = min(unsigned long, count, avail);
 	res = strnlen(((char *)bh->b_data)+(offset&ROMBMASK), maxsize);
 	brelse(bh);
 
@@ -211,7 +206,7 @@
 		bh = bread(i->i_dev, offset>>ROMBSBITS, ROMBSIZE);
 		if (!bh)
 			return -1;
-		maxsize = min(count-res, ROMBSIZE);
+		maxsize = min(unsigned long, count - res, ROMBSIZE);
 		avail = strnlen(bh->b_data, maxsize);
 		res += avail;
 		brelse(bh);
@@ -236,7 +231,7 @@
 		return -1;		/* error */
 
 	avail = ROMBSIZE - (offset & ROMBMASK);
-	maxsize = min(count, avail);
+	maxsize = min(unsigned long, count, avail);
 	memcpy(dest, ((char *)bh->b_data) + (offset & ROMBMASK), maxsize);
 	brelse(bh);
 
@@ -249,7 +244,7 @@
 		bh = bread(i->i_dev, offset>>ROMBSBITS, ROMBSIZE);
 		if (!bh)
 			return -1;
-		maxsize = min(count-res, ROMBSIZE);
+		maxsize = min(unsigned long, count - res, ROMBSIZE);
 		memcpy(dest, bh->b_data, maxsize);
 		brelse(bh);
 		res += maxsize;
@@ -413,7 +408,7 @@
 	offset = page->index << PAGE_CACHE_SHIFT;
 	if (offset < inode->i_size) {
 		avail = inode->i_size-offset;
-		readlen = min(avail, PAGE_SIZE);
+		readlen = min(unsigned long, avail, PAGE_SIZE);
 		if (romfs_copyfrom(inode, buf, inode->u.romfs_i.i_dataoffset+offset, readlen) == readlen) {
 			if (readlen < PAGE_SIZE) {
 				memset(buf + readlen,0,PAGE_SIZE-readlen);

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