]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/appletalk-fix-compile-regression.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / queue-4.19 / appletalk-fix-compile-regression.patch
1 From 6a47483c25635f37e5ccb540abdeaab325162703 Mon Sep 17 00:00:00 2001
2 From: Arnd Bergmann <arnd@arndb.de>
3 Date: Wed, 6 Mar 2019 11:52:36 +0100
4 Subject: appletalk: Fix compile regression
5
6 [ Upstream commit 27da0d2ef998e222a876c0cec72aa7829a626266 ]
7
8 A bugfix just broke compilation of appletalk when CONFIG_SYSCTL
9 is disabled:
10
11 In file included from net/appletalk/ddp.c:65:
12 net/appletalk/ddp.c: In function 'atalk_init':
13 include/linux/atalk.h:164:34: error: expected expression before 'do'
14 #define atalk_register_sysctl() do { } while(0)
15 ^~
16 net/appletalk/ddp.c:1934:7: note: in expansion of macro 'atalk_register_sysctl'
17 rc = atalk_register_sysctl();
18
19 This is easier to avoid by using conventional inline functions
20 as stubs rather than macros. The header already has inline
21 functions for other purposes, so I'm changing over all the
22 macros for consistency.
23
24 Fixes: 6377f787aeb9 ("appletalk: Fix use-after-free in atalk_proc_exit")
25 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
26 Signed-off-by: David S. Miller <davem@davemloft.net>
27 Signed-off-by: Sasha Levin <sashal@kernel.org>
28 ---
29 include/linux/atalk.h | 18 ++++++++++++++----
30 1 file changed, 14 insertions(+), 4 deletions(-)
31
32 diff --git a/include/linux/atalk.h b/include/linux/atalk.h
33 index 5a90f28d5ff2..d5cfc0b15b76 100644
34 --- a/include/linux/atalk.h
35 +++ b/include/linux/atalk.h
36 @@ -161,16 +161,26 @@ extern int sysctl_aarp_resolve_time;
37 extern int atalk_register_sysctl(void);
38 extern void atalk_unregister_sysctl(void);
39 #else
40 -#define atalk_register_sysctl() do { } while(0)
41 -#define atalk_unregister_sysctl() do { } while(0)
42 +static inline int atalk_register_sysctl(void)
43 +{
44 + return 0;
45 +}
46 +static inline void atalk_unregister_sysctl(void)
47 +{
48 +}
49 #endif
50
51 #ifdef CONFIG_PROC_FS
52 extern int atalk_proc_init(void);
53 extern void atalk_proc_exit(void);
54 #else
55 -#define atalk_proc_init() ({ 0; })
56 -#define atalk_proc_exit() do { } while(0)
57 +static inline int atalk_proc_init(void)
58 +{
59 + return 0;
60 +}
61 +static inline void atalk_proc_exit(void)
62 +{
63 +}
64 #endif /* CONFIG_PROC_FS */
65
66 #endif /* __LINUX_ATALK_H__ */
67 --
68 2.19.1
69