sh: implicit access_ok() needs an #include
PATCH v2 1/1 sh: implicit access_ok() needs an #include
Building arch/sh/ has a build error/warning that is fixed by adding an #include of a header file.
../arch/sh/include/asm/checksum_32.h: In function 'csum_and_copy_from_user':../arch/sh/include/asm/checksum_32.h:53:14: error: implicit declaration of function 'access_ok' [-Werror=implicit-function-declaration]
53 | if (!access_ok(src, len))
| ^~~~~~~~~
---
v2: add Subject: and patch description
arch/sh/include/asm/checksum_32.h | 1 + 1 file changed, 1 insertion(+)
arch/sh/include/asm/checksum_32.h +1 -0
@@ -7,6 +7,7 @@*/ #include <linux/in6.h> +#include <asm-generic/access_ok.h> /* * computes the checksum of a memory block at buff, length len,
Quoted 19 lines · Randy Dunlap
Building
arch/sh/has a build error/warning that is fixed by adding an #include of a header file.
../arch/sh/include/asm/checksum_32.h: In function 'csum_and_copy_from_user':../arch/sh/include/asm/checksum_32.h:53:14: error: implicit declaration of function 'access_ok' [-Werror=implicit-function-declaration]
53 | if (!access_ok(src, len))| ^~~~~~~~~Fixes 7fe8970a78a1 ("sh32: convert to csum_and_copy_from_user()")Signed-off-by Randy Dunlap <[email protected]>Cc Al Viro <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Andrew Morton <[email protected]>
Quoted 2 lines
---
v2: add Subject: and patch description
Thanks for the fix!
arch/sh/include/asm/checksum_32.h line 10
Quoted 12 lines
arch/sh/include/asm/checksum_32.h | 1 + 1 file changed, 1 insertion(+)diff --
a/arch/sh/include/asm/checksum_32.hb/arch/sh/include/asm/checksum_32.harch/sh/include/asm/checksum_32.h +1
-0@@ -7,6 +7,7 @@*/ #include <linux/in6.h> +#include <asm-generic/access_ok.h>
This will work correctly, but it is not the intended usage of the header. Anything in asm-generic/*.h should only be included by a particular header, usually the asm/*.h with the same name or in this case the asm/uaccess.h header.
I think the correct fix here is to include asm/uaccess.h instead of asm-generic/access_ok.h.
Arnd
Hi Arnd,
Quoted 43 lines · Arnd Bergmann
Quoted 19 lines · Randy Dunlap
Building
arch/sh/has a build error/warning that is fixed by adding an #include of a header file.
../arch/sh/include/asm/checksum_32.h: In function 'csum_and_copy_from_user':../arch/sh/include/asm/checksum_32.h:53:14: error: implicit declaration of function 'access_ok' [-Werror=implicit-function-declaration]
53 | if (!access_ok(src, len))| ^~~~~~~~~Fixes 7fe8970a78a1 ("sh32: convert to csum_and_copy_from_user()")Signed-off-by Randy Dunlap <[email protected]>Cc Al Viro <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Andrew Morton <[email protected]>Quoted 2 lines
---
v2: add Subject: and patch descriptionThanks for the fix!
arch/sh/include/asm/checksum_32.h line 10
Quoted 12 lines
arch/sh/include/asm/checksum_32.h | 1 + 1 file changed, 1 insertion(+)diff --
a/arch/sh/include/asm/checksum_32.hb/arch/sh/include/asm/checksum_32.harch/sh/include/asm/checksum_32.h +1
-0@@ -7,6 +7,7 @@*/ #include <linux/in6.h> +#include <asm-generic/access_ok.h> This will work correctly, but it is not the intended usage of the header. Anything in asm-generic/*.h should only be included by a particular header, usually the asm/*.h with the same name or in this case the
asm/uaccess.hheader.
Quoted 2 lines
I think the correct fix here is to include
asm/uaccess.hinstead ofasm-generic/access_ok.h.
Which should already be there, or RSN:
https://lore.kernel.org/all/167514181688.11863.771497291150527329.git-patchwork-notify@kernel.org
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Quoted 46 lines · Geert Uytterhoeven
Hi Arnd,
Quoted 43 lines · Arnd Bergmann
Quoted 19 lines · Randy Dunlap
Building
arch/sh/has a build error/warning that is fixed by adding an #include of a header file.
../arch/sh/include/asm/checksum_32.h: In function 'csum_and_copy_from_user':../arch/sh/include/asm/checksum_32.h:53:14: error: implicit declaration of function 'access_ok' [-Werror=implicit-function-declaration]
53 | if (!access_ok(src, len))| ^~~~~~~~~Fixes 7fe8970a78a1 ("sh32: convert to csum_and_copy_from_user()")Signed-off-by Randy Dunlap <[email protected]>Cc Al Viro <[email protected]>Cc Yoshinori Sato <[email protected]>Cc Rich Felker <[email protected]>Cc John Paul Adrian Glaubitz <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Andrew Morton <[email protected]>Quoted 2 lines
---
v2: add Subject: and patch descriptionThanks for the fix!
arch/sh/include/asm/checksum_32.h line 10
Quoted 12 lines
arch/sh/include/asm/checksum_32.h | 1 + 1 file changed, 1 insertion(+)diff --
a/arch/sh/include/asm/checksum_32.hb/arch/sh/include/asm/checksum_32.harch/sh/include/asm/checksum_32.h +1
-0@@ -7,6 +7,7 @@*/ #include <linux/in6.h> +#include <asm-generic/access_ok.h> This will work correctly, but it is not the intended usage of the header. Anything in asm-generic/*.h should only be included by a particular header, usually the asm/*.h with the same name or in this case the
asm/uaccess.hheader.
Quoted 5 lines
Quoted 2 lines
I think the correct fix here is to include
asm/uaccess.hinstead ofasm-generic/access_ok.h.Which should already be there, or RSN:
https://lore.kernel.org/all/167514181688.11863.771497291150527329.git-patchwork-notify@kernel.org
Good to see that. And thanks to both of you.
Signature · 1 line
~Randy