diff mbox series

[net-next,v2] compat: always include linux/compat.h from net/compat.h

Message ID 20201121214844.1488283-1-kuba@kernel.org (mailing list archive)
State Accepted
Commit fc0d3b24bdb7a523e973e49648c45d240320ee95
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v2] compat: always include linux/compat.h from net/compat.h | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 37 this patch: 37
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 22 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 271 this patch: 271
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Jakub Kicinski Nov. 21, 2020, 9:48 p.m. UTC
We're about to do reshuffling in networking headers and
eliminate some implicit includes. This results in:

In file included from ../net/ipv4/netfilter/arp_tables.c:26:
include/net/compat.h:60:40: error: unknown type name ‘compat_uptr_t’; did you mean ‘compat_ptr_ioctl’?
    struct sockaddr __user **save_addr, compat_uptr_t *ptr,
                                        ^~~~~~~~~~~~~
                                        compat_ptr_ioctl
include/net/compat.h:61:4: error: unknown type name ‘compat_size_t’; did you mean ‘compat_sigset_t’?
    compat_size_t *len);
    ^~~~~~~~~~~~~
    compat_sigset_t

Currently net/compat.h depends on linux/compat.h being included
first. After the upcoming changes this would break the 32bit build.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--
v2:
 - correct the commit message
 - remove the ifdef completely (Arnd)
---
 include/net/compat.h | 10 ----------
 1 file changed, 10 deletions(-)

Comments

Arnd Bergmann Nov. 22, 2020, 11:23 a.m. UTC | #1
On Sat, Nov 21, 2020 at 10:49 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> We're about to do reshuffling in networking headers and
> eliminate some implicit includes. This results in:
>
> In file included from ../net/ipv4/netfilter/arp_tables.c:26:
> include/net/compat.h:60:40: error: unknown type name ‘compat_uptr_t’; did you mean ‘compat_ptr_ioctl’?
>     struct sockaddr __user **save_addr, compat_uptr_t *ptr,
>                                         ^~~~~~~~~~~~~
>                                         compat_ptr_ioctl
> include/net/compat.h:61:4: error: unknown type name ‘compat_size_t’; did you mean ‘compat_sigset_t’?
>     compat_size_t *len);
>     ^~~~~~~~~~~~~
>     compat_sigset_t
>
> Currently net/compat.h depends on linux/compat.h being included
> first. After the upcoming changes this would break the 32bit build.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Christoph Hellwig Nov. 23, 2020, 8:06 a.m. UTC | #2
Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
patchwork-bot+netdevbpf@kernel.org Nov. 23, 2020, 9:40 p.m. UTC | #3
Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Sat, 21 Nov 2020 13:48:44 -0800 you wrote:
> We're about to do reshuffling in networking headers and
> eliminate some implicit includes. This results in:
> 
> In file included from ../net/ipv4/netfilter/arp_tables.c:26:
> include/net/compat.h:60:40: error: unknown type name ‘compat_uptr_t’; did you mean ‘compat_ptr_ioctl’?
>     struct sockaddr __user **save_addr, compat_uptr_t *ptr,
>                                         ^~~~~~~~~~~~~
>                                         compat_ptr_ioctl
> include/net/compat.h:61:4: error: unknown type name ‘compat_size_t’; did you mean ‘compat_sigset_t’?
>     compat_size_t *len);
>     ^~~~~~~~~~~~~
>     compat_sigset_t
> 
> [...]

Here is the summary with links:
  - [net-next,v2] compat: always include linux/compat.h from net/compat.h
    https://git.kernel.org/netdev/net-next/c/fc0d3b24bdb7

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/include/net/compat.h b/include/net/compat.h
index 745db0d605b6..84805bdc4435 100644
--- a/include/net/compat.h
+++ b/include/net/compat.h
@@ -5,8 +5,6 @@ 
 
 struct sock;
 
-#if defined(CONFIG_COMPAT)
-
 #include <linux/compat.h>
 
 struct compat_msghdr {
@@ -48,14 +46,6 @@  struct compat_rtentry {
 	unsigned short  rt_irtt;        /* Initial RTT                  */
 };
 
-#else /* defined(CONFIG_COMPAT) */
-/*
- * To avoid compiler warnings:
- */
-#define compat_msghdr	msghdr
-#define compat_mmsghdr	mmsghdr
-#endif /* defined(CONFIG_COMPAT) */
-
 int __get_compat_msghdr(struct msghdr *kmsg, struct compat_msghdr __user *umsg,
 			struct sockaddr __user **save_addr, compat_uptr_t *ptr,
 			compat_size_t *len);