Skip to contentSkip to conversation

x86, vsyscall: Fix sparse warning: Using plain integer as NULL

PATCH In review Emil Goode 2 participants 3 messages Apr 1, 2012 – Apr 6, 2012

Subsystems (2)
lore
Share & tools
lore

Emil Goode

author
#0 lore raw

PATCH v2 1/1 x86, vsyscall: Fix sparse warning: Using plain integer as NULL

Decided to change the comment instead as well.

This patch silences the following sparse warning:
arch/x86/kernel/vsyscall_64.c:250:34:
warning: Using plain integer as NULL pointer

---
v2: Changed comment to "NULL" instead of "0"

 arch/x86/kernel/vsyscall_64.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/vsyscall_64.c +3 -3
index f386dc4..7515cf0 100644
@@ -216,9 +216,9 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
 	current_thread_info()->sig_on_uaccess_error = 1;
 
 	/*
-	 * 0 is a valid user pointer (in the access_ok sense) on 32-bit and
+	 * NULL is a valid user pointer (in the access_ok sense) on 32-bit and
 	 * 64-bit, so we don't need to special-case it here.  For all the
-	 * vsyscalls, 0 means "don't write anything" not "write it at
+	 * vsyscalls, NULL means "don't write anything" not "write it at
 	 * address 0".
 	 */
 	ret = -EFAULT;
@@ -247,7 +247,7 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
 
 		ret = sys_getcpu((unsigned __user *)regs->di,
 				 (unsigned __user *)regs->si,
-				 0);
+				 NULL);
 		break;
 	}
 
Signature · 1 line
1.7.9.1
Acked-by on v2 1/1
#1 lore raw
Quoted 39 lines · Emil Goode

Decided to change the comment instead as well.

This patch silences the following sparse warning:
arch/x86/kernel/vsyscall_64.c:250:34:
      warning: Using plain integer as NULL pointer

---
v2: Changed comment to "NULL" instead of "0"

 arch/x86/kernel/vsyscall_64.c |    6 +++---

 1 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/vsyscall_64.c +3 -4
index f386dc4..7515cf0 100644
@@ -216,9 +216,9 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
        current_thread_info()->sig_on_uaccess_error = 1;
 
        /*
-        * 0 is a valid user pointer (in the access_ok sense) on 32-bit and
+        * NULL is a valid user pointer (in the access_ok sense) on 32-bit and
         * 64-bit, so we don't need to special-case it here.  For all the
-        * vsyscalls, 0 means "don't write anything" not "write it at
+        * vsyscalls, NULL means "don't write anything" not "write it at
         * address 0".
         */
        ret = -EFAULT;
@@ -247,7 +247,7 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
 
                ret = sys_getcpu((unsigned __user *)regs->di,
                                 (unsigned __user *)regs->si,
-                                0);
+                                NULL);
                break;
        }
 
--
Quoted 2 lines

1.7.9.1

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

[tip:x86/urgent] x86: vsyscall: Use NULL instead 0 for a pointer argument

In reply to Emil Goode
Commit-ID:  46ed99d1b7c92920ce9e313152522847647aae4f
Gitweb:     http://git.kernel.org/tip/46ed99d1b7c92920ce9e313152522847647aae4f
Author:     Emil Goode <[email protected]>
AuthorDate: Sun, 1 Apr 2012 20:48:04 +0200
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Fri, 6 Apr 2012 11:49:59 +0200

x86: vsyscall: Use NULL instead 0 for a pointer argument

This patch silences the following sparse warning:
arch/x86/kernel/vsyscall_64.c:250:34:
warning: Using plain integer as NULL pointer

---
 arch/x86/kernel/vsyscall_64.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/vsyscall_64.c +3 -3
index f386dc4..7515cf0 100644
@@ -216,9 +216,9 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
 	current_thread_info()->sig_on_uaccess_error = 1;
 
 	/*
-	 * 0 is a valid user pointer (in the access_ok sense) on 32-bit and
+	 * NULL is a valid user pointer (in the access_ok sense) on 32-bit and
 	 * 64-bit, so we don't need to special-case it here.  For all the
-	 * vsyscalls, 0 means "don't write anything" not "write it at
+	 * vsyscalls, NULL means "don't write anything" not "write it at
 	 * address 0".
 	 */
 	ret = -EFAULT;
@@ -247,7 +247,7 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
 
 		ret = sys_getcpu((unsigned __user *)regs->di,
 				 (unsigned __user *)regs->si,
-				 0);
+				 NULL);
 		break;
 	}