Skip to contentSkip to conversation

parisc: Avoid compiler warnings with access_ok()

PATCH New Helge Deller 1 participant 1 message Mar 15, 2017 PA-RISC architecture

lore
Share & tools
lore

Helge Deller

author maintainer
#0 lore raw

PATCH 1/1 parisc: Avoid compiler warnings with access_ok()

Commit 09b871ffd4d8 (parisc: Define access_ok() as macro) missed to mark uaddr as used, which then gives compiler warnings about unused variables.

Fix it by comparing uaddr to uaddr which then gets optimized away by the compiler.

Fixes 09b871ffd4d8 ("parisc: Define access_ok() as macro")
arch/parisc/include/asm/uaccess.h +2 -1
index fb4382c..edfbf9d 100644
@@ -32,7 +32,8 @@
  * that put_user is the same as __put_user, etc.
  */
 
-#define access_ok(type, uaddr, size) (1)
+#define access_ok(type, uaddr, size)	\
+	( (uaddr) == (uaddr) )
 
 #define put_user __put_user
 #define get_user __get_user