Re: [patch -mm series] ia64 specific /dev/mem handlers

From: Jes Sorensen <jes_at_wildopensource.com>
Date: 2005-03-04 23:26:31
>>>>> "Jes" == Jes Sorensen <jes@wildopensource.com> writes:

>>>>> "Andrew" == Andrew Morton <akpm@osdl.org> writes:
Andrew> This patch causes hiccups on my ia32e box.

Andrew> linux:/home/akpm# /usr/sbin/hwscan --isapnp zsh: 7528
Andrew> segmentation fault

Jes> Weird, I'll take a look.

-EPROGRAMMERISANIDIOT ... try this.

Cheers,
Jes

/dev/mem handle read/write case where ppos+count < PAGE_SIZE

Signed-off-by: Jes Sorensen <jes@wildopensource.com>


--- ../old/linux-2.6.11-rc5-mm1/drivers/char/mem.c	2005-03-04 07:20:51.000000000 -0500
+++ drivers/char/mem.c	2005-03-04 07:22:20.000000000 -0500
@@ -152,7 +152,9 @@
 		if (-p & (PAGE_SIZE - 1))
 			sz = -p & (PAGE_SIZE - 1);
 		else
-			sz = min_t(unsigned long, PAGE_SIZE, count);
+			sz = PAGE_SIZE;
+
+		sz = min_t(unsigned long, sz, count);
 
 		/*
 		 * On ia64 if a page has been mapped somewhere as
@@ -207,7 +209,9 @@
 		if (-p & (PAGE_SIZE - 1))
 			sz = -p & (PAGE_SIZE - 1);
 		else
-			sz = min_t(unsigned long, PAGE_SIZE, count);
+			sz = PAGE_SIZE;
+
+		sz = min_t(unsigned long, sz, count);
 
 		/*
 		 * On ia64 if a page has been mapped somewhere as
@@ -353,7 +357,9 @@
 			if (-p & (PAGE_SIZE - 1))
 				sz = -p & (PAGE_SIZE - 1);
 			else
-				sz = min_t(unsigned long, PAGE_SIZE, count);
+				sz = PAGE_SIZE;
+
+			sz = min_t(unsigned long, sz, count);
 
 			/*
 			 * On ia64 if a page has been mapped somewhere as
@@ -430,7 +436,9 @@
 		if (-realp & (PAGE_SIZE - 1))
 			sz = -realp & (PAGE_SIZE - 1);
 		else
-			sz = min_t(unsigned long, PAGE_SIZE, count);
+			sz = PAGE_SIZE;
+
+		sz = min_t(unsigned long, sz, count);
 
 		/*
 		 * On ia64 if a page has been mapped somewhere as
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Fri Mar 4 07:45:17 2005

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:36 EST