Skip to contentSkip to conversation

string: do not export memweight() to userspace

PATCH In review Cong Wang 2 participants 2 messages Aug 6, 2012 Generic string library

lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH 1/1 string: do not export memweight() to userspace

From: WANG Cong <[email protected]>

This patch fixes the following warning:

usr/include/linux/string.h:8: userspace cannot reference function or variable defined in the kernel

Cc Akinobu Mita <[email protected]>

---

include/linux/string.h +1 -1
index ffe0442..b917881 100644
@@ -144,8 +144,8 @@ static inline bool strstarts(const char *str, const char *prefix)
 {
 	return strncmp(str, prefix, strlen(prefix)) == 0;
 }
-#endif
 
 extern size_t memweight(const void *ptr, size_t bytes);
 
+#endif /* __KERNEL__ */
 #endif /* _LINUX_STRING_H_ */
#1 lore raw

2012/8/6 Cong Wang <[email protected]>:

Quoted 5 lines

From: WANG Cong <[email protected]>

This patch fixes the following warning:

usr/include/linux/string.h:8: userspace cannot reference function or variable defined in the kernel

Thanks for finding this problem.
Looks good to me.

Quoted 18 lines
Cc Akinobu Mita <[email protected]>

---

include/linux/string.h +1 -1
index ffe0442..b917881 100644
@@ -144,8 +144,8 @@ static inline bool strstarts(const char *str, const char *prefix)
 {
        return strncmp(str, prefix, strlen(prefix)) == 0;
 }
-#endif
 
 extern size_t memweight(const void *ptr, size_t bytes);
 
+#endif /* __KERNEL__ */
 #endif /* _LINUX_STRING_H_ */