Skip to contentSkip to conversation

Trivial sparse cleanups

PPC64 David Gibson 2 participants 2 messages Oct 21, 2004 – Oct 23, 2004

lore
Share & tools
lore
#0 lore raw

Andrew, please apply:

This patch squashes a handful of assorted sparse warnings in the ppc64 code. Should be pretty much trivial and self explanatory.

arch/ppc64/kernel/nvram.c +2 -2
Index: working-2.6/arch/ppc64/kernel/nvram.c
===================================================================
@@ -77,7 +77,7 @@
 }
 
 
-static ssize_t dev_nvram_read(struct file *file, char *buf,
+static ssize_t dev_nvram_read(struct file *file, char __user *buf,
 			  size_t count, loff_t *ppos)
 {
 	ssize_t len;
@@ -117,7 +117,7 @@
 
 }
 
-static ssize_t dev_nvram_write(struct file *file, const char *buf,
+static ssize_t dev_nvram_write(struct file *file, const char __user *buf,
 			   size_t count, loff_t *ppos)
 {
 	ssize_t len;
arch/ppc64/kernel/setup.c +1 -1
Index: working-2.6/arch/ppc64/kernel/setup.c
===================================================================
@@ -1111,7 +1111,7 @@
 {
 	/* ensure xmon is enabled */
 	xmon_init();
-	debugger(0);
+	debugger(NULL);
 
 	return 0;
 }
arch/ppc64/mm/hugetlbpage.c +1 -1
Index: working-2.6/arch/ppc64/mm/hugetlbpage.c
===================================================================
@@ -249,7 +249,7 @@
 {
 	if (within_hugepage_high_range(addr, len))
 		return 0;
-	else if ((addr < 0x100000000) && ((addr+len) < 0x100000000)) {
+	else if ((addr < 0x100000000UL) && ((addr+len) < 0x100000000UL)) {
 		int err;
 		/* Yes, we need both tests, in case addr+len overflows
 		 * 64-bit arithmetic */
arch/ppc64/mm/hash_utils.c +1 -1
Index: working-2.6/arch/ppc64/mm/hash_utils.c
===================================================================
@@ -401,7 +401,7 @@
 		info.si_signo = SIGBUS;
 		info.si_errno = 0;
 		info.si_code = BUS_ADRERR;
-		info.si_addr = (void *)address;
+		info.si_addr = (void __user *)address;
 		force_sig_info(SIGBUS, &info, current);
 		return;
 	}
Signature · 4 lines
David Gibson			| For every complex problem there is a
david AT gibson.dropbear.id.au	| solution which is simple, neat and
				| wrong.
http://www.ozlabs.org/people/dgibson