Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1562612 > unrolled thread

[PATCH] net: atm: Fix build error when !CONFIG_PROC_FS

Started byAugusto Mecking Caringi <augustocaringi@gmail.com>
First post2017-01-19 12:10 +0100
Last post2017-01-19 17:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: atm: Fix build error when !CONFIG_PROC_FS Augusto Mecking Caringi <augustocaringi@gmail.com> - 2017-01-19 12:10 +0100
    Re: [PATCH] net: atm: Fix build error when !CONFIG_PROC_FS David Miller <davem@davemloft.net> - 2017-01-19 17:40 +0100

#1562612 — [PATCH] net: atm: Fix build error when !CONFIG_PROC_FS

FromAugusto Mecking Caringi <augustocaringi@gmail.com>
Date2017-01-19 12:10 +0100
Subject[PATCH] net: atm: Fix build error when !CONFIG_PROC_FS
Message-ID<t1iLo-MP-7@gated-at.bofh.it>
When CONFIG_ATM_CLIP is set and CONFIG_PROC_FS is not set, the building
was failing whith the error:

net/atm/clip.c: In function ‘atm_clip_exit’:
net/atm/clip.c:933:27: error: ‘atm_proc_root’ undeclared (first use in
this function)
remove_proc_entry("arp", atm_proc_root);
                           ^

Fix it by putting the proc cleanup code inside a #ifdef CONFIG_PROC_FS
block.

Signed-off-by: Augusto Mecking Caringi <augustocaringi@gmail.com>
---
 net/atm/clip.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/atm/clip.c b/net/atm/clip.c
index 53b4ac0..75221e4 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -930,7 +930,9 @@ static void atm_clip_exit_noproc(void)
 
 static void __exit atm_clip_exit(void)
 {
+#ifdef CONFIG_PROC_FS
 	remove_proc_entry("arp", atm_proc_root);
+#endif
 
 	atm_clip_exit_noproc();
 }
-- 
2.7.4

[toc] | [next] | [standalone]


#1562888

FromDavid Miller <davem@davemloft.net>
Date2017-01-19 17:40 +0100
Message-ID<t1nUL-3Tq-27@gated-at.bofh.it>
In reply to#1562612
From: Augusto Mecking Caringi <augustocaringi@gmail.com>
Date: Thu, 19 Jan 2017 11:00:12 +0000

> When CONFIG_ATM_CLIP is set and CONFIG_PROC_FS is not set, the building
> was failing whith the error:
> 
> net/atm/clip.c: In function ‘atm_clip_exit’:
> net/atm/clip.c:933:27: error: ‘atm_proc_root’ undeclared (first use in
> this function)
> remove_proc_entry("arp", atm_proc_root);
>                            ^
> 
> Fix it by putting the proc cleanup code inside a #ifdef CONFIG_PROC_FS
> block.
> 
> Signed-off-by: Augusto Mecking Caringi <augustocaringi@gmail.com>

When CONFIG_PROC_FS is not defined, remove_proc_entry is defined as the
macro:

#define remove_proc_entry(name, parent) do {} while (0)

Therefore it is impossible for atm_proc_root to be referened in any way.

The fallback macro is designed exactly so that ugly ifdefs like the one
you are proposing aren't necessary.

I'm not applyiing this patch, something else is happening in your tree.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web