* [PATCH v2] sh: implicit access_ok() needs an #include
@ 2023-02-02 5:31 Randy Dunlap
2023-02-02 7:45 ` Arnd Bergmann
0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2023-02-02 5:31 UTC (permalink / raw)
To: linux-kernel
Cc: Randy Dunlap, Al Viro, Yoshinori Sato, Rich Felker, linux-sh,
John Paul Adrian Glaubitz, Arnd Bergmann, Andrew Morton
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 <rdunlap@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: linux-sh@vger.kernel.org
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
v2: add Subject: and patch description
arch/sh/include/asm/checksum_32.h | 1 +
1 file changed, 1 insertion(+)
diff -- a/arch/sh/include/asm/checksum_32.h b/arch/sh/include/asm/checksum_32.h
--- a/arch/sh/include/asm/checksum_32.h
+++ b/arch/sh/include/asm/checksum_32.h
@@ -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,
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] sh: implicit access_ok() needs an #include
2023-02-02 5:31 [PATCH v2] sh: implicit access_ok() needs an #include Randy Dunlap
@ 2023-02-02 7:45 ` Arnd Bergmann
2023-02-02 8:22 ` Geert Uytterhoeven
0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2023-02-02 7:45 UTC (permalink / raw)
To: Randy Dunlap, linux-kernel
Cc: Alexander Viro, Yoshinori Sato, Rich Felker, linux-sh,
John Paul Adrian Glaubitz, Andrew Morton
On Thu, Feb 2, 2023, at 06:31, Randy Dunlap wrote:
> 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 <rdunlap@infradead.org>
> Cc: Al Viro <viro@zeniv.linux.org.uk>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Rich Felker <dalias@libc.org>
> Cc: linux-sh@vger.kernel.org
> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> ---
> v2: add Subject: and patch description
Thanks for the fix!
>
> arch/sh/include/asm/checksum_32.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff -- a/arch/sh/include/asm/checksum_32.h b/arch/sh/include/asm/checksum_32.h
> --- a/arch/sh/include/asm/checksum_32.h
> +++ b/arch/sh/include/asm/checksum_32.h
> @@ -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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] sh: implicit access_ok() needs an #include
2023-02-02 7:45 ` Arnd Bergmann
@ 2023-02-02 8:22 ` Geert Uytterhoeven
2023-02-02 15:22 ` Randy Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2023-02-02 8:22 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Randy Dunlap, linux-kernel, Alexander Viro, Yoshinori Sato,
Rich Felker, linux-sh, John Paul Adrian Glaubitz, Andrew Morton
Hi Arnd,
On Thu, Feb 2, 2023 at 8:52 AM Arnd Bergmann <arnd@arndb.de> wrote:
> On Thu, Feb 2, 2023, at 06:31, Randy Dunlap wrote:
> > 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 <rdunlap@infradead.org>
> > Cc: Al Viro <viro@zeniv.linux.org.uk>
> > Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> > Cc: Rich Felker <dalias@libc.org>
> > Cc: linux-sh@vger.kernel.org
> > Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > ---
> > v2: add Subject: and patch description
>
> Thanks for the fix!
>
> >
> > arch/sh/include/asm/checksum_32.h | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff -- a/arch/sh/include/asm/checksum_32.h b/arch/sh/include/asm/checksum_32.h
> > --- a/arch/sh/include/asm/checksum_32.h
> > +++ b/arch/sh/include/asm/checksum_32.h
> > @@ -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.
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 -- geert@linux-m68k.org
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] sh: implicit access_ok() needs an #include
2023-02-02 8:22 ` Geert Uytterhoeven
@ 2023-02-02 15:22 ` Randy Dunlap
0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2023-02-02 15:22 UTC (permalink / raw)
To: Geert Uytterhoeven, Arnd Bergmann
Cc: linux-kernel, Alexander Viro, Yoshinori Sato, Rich Felker,
linux-sh, John Paul Adrian Glaubitz, Andrew Morton
On 2/2/23 00:22, Geert Uytterhoeven wrote:
> Hi Arnd,
>
> On Thu, Feb 2, 2023 at 8:52 AM Arnd Bergmann <arnd@arndb.de> wrote:
>> On Thu, Feb 2, 2023, at 06:31, Randy Dunlap wrote:
>>> 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 <rdunlap@infradead.org>
>>> Cc: Al Viro <viro@zeniv.linux.org.uk>
>>> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
>>> Cc: Rich Felker <dalias@libc.org>
>>> Cc: linux-sh@vger.kernel.org
>>> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
>>> Cc: Arnd Bergmann <arnd@arndb.de>
>>> Cc: Andrew Morton <akpm@linux-foundation.org>
>>> ---
>>> v2: add Subject: and patch description
>>
>> Thanks for the fix!
>>
>>>
>>> arch/sh/include/asm/checksum_32.h | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff -- a/arch/sh/include/asm/checksum_32.h b/arch/sh/include/asm/checksum_32.h
>>> --- a/arch/sh/include/asm/checksum_32.h
>>> +++ b/arch/sh/include/asm/checksum_32.h
>>> @@ -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.
>
> 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.
--
~Randy
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-02-02 15:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-02 5:31 [PATCH v2] sh: implicit access_ok() needs an #include Randy Dunlap
2023-02-02 7:45 ` Arnd Bergmann
2023-02-02 8:22 ` Geert Uytterhoeven
2023-02-02 15:22 ` Randy Dunlap
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.