All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hostap: hide unused procfs helpers
@ 2018-07-13  7:03 YueHaibing
  2018-07-13  7:26   ` Arend van Spriel
  2018-07-31  7:21 ` Kalle Valo
  0 siblings, 2 replies; 10+ messages in thread
From: YueHaibing @ 2018-07-13  7:03 UTC (permalink / raw)
  To: j, kvalo; +Cc: linux-kernel, netdev, linux-wireless, davem, YueHaibing

When CONFIG_PROC_FS isn't set, gcc warning this:

drivers/net/wireless/intersil/hostap/hostap_hw.c:2901:12: warning: ‘prism2_registers_proc_show’ defined but not used [-Wunused-function]
 static int prism2_registers_proc_show(struct seq_file *m, void *v)

drivers/net/wireless/intersil/hostap/hostap_proc.c:16:12: warning: ‘prism2_debug_proc_show’ defined but not used [-Wunused-function]
 static int prism2_debug_proc_show(struct seq_file *m, void *v)
            ^
drivers/net/wireless/intersil/hostap/hostap_proc.c:49:12: warning: ‘prism2_stats_proc_show’ defined but not used [-Wunused-function]
 static int prism2_stats_proc_show(struct seq_file *m, void *v)
            ^
drivers/net/wireless/intersil/hostap/hostap_proc.c:177:12: warning: ‘prism2_crypt_proc_show’ defined but not used [-Wunused-function]
 static int prism2_crypt_proc_show(struct seq_file *m, void *v)
            ^

fix this by adding #ifdef around them.
hfa384x_read_reg is only used by prism2_registers_proc_show,so move it
into #ifdef.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/wireless/intersil/hostap/hostap_ap.c   |  8 ++++----
 drivers/net/wireless/intersil/hostap/hostap_hw.c   | 17 +++++++----------
 drivers/net/wireless/intersil/hostap/hostap_proc.c | 10 ++++++----
 3 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/drivers/net/wireless/intersil/hostap/hostap_ap.c b/drivers/net/wireless/intersil/hostap/hostap_ap.c
index d1884b8..0094b1d 100644
--- a/drivers/net/wireless/intersil/hostap/hostap_ap.c
+++ b/drivers/net/wireless/intersil/hostap/hostap_ap.c
@@ -66,7 +66,7 @@ static void prism2_send_mgmt(struct net_device *dev,
 #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
 
 
-#ifndef PRISM2_NO_PROCFS_DEBUG
+#if !defined(PRISM2_NO_PROCFS_DEBUG) && defined(CONFIG_PROC_FS)
 static int ap_debug_proc_show(struct seq_file *m, void *v)
 {
 	struct ap_data *ap = PDE_DATA(file_inode(m->file));
@@ -81,8 +81,7 @@ static int ap_debug_proc_show(struct seq_file *m, void *v)
 	seq_printf(m, "tx_drop_nonassoc=%u\n", ap->tx_drop_nonassoc);
 	return 0;
 }
-#endif /* PRISM2_NO_PROCFS_DEBUG */
-
+#endif
 
 static void ap_sta_hash_add(struct ap_data *ap, struct sta_info *sta)
 {
@@ -990,7 +989,7 @@ static void prism2_send_mgmt(struct net_device *dev,
 }
 #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
 
-
+#ifdef CONFIG_PROC_FS
 static int prism2_sta_proc_show(struct seq_file *m, void *v)
 {
 	struct sta_info *sta = m->private;
@@ -1059,6 +1058,7 @@ static int prism2_sta_proc_show(struct seq_file *m, void *v)
 
 	return 0;
 }
+#endif
 
 static void handle_add_proc_queue(struct work_struct *work)
 {
diff --git a/drivers/net/wireless/intersil/hostap/hostap_hw.c b/drivers/net/wireless/intersil/hostap/hostap_hw.c
index 2720aa3..ad1aa65 100644
--- a/drivers/net/wireless/intersil/hostap/hostap_hw.c
+++ b/drivers/net/wireless/intersil/hostap/hostap_hw.c
@@ -151,13 +151,6 @@ static int prism2_get_ram_size(local_info_t *local);
 #define HFA384X_MAGIC 0x8A32
 #endif
 
-
-static u16 hfa384x_read_reg(struct net_device *dev, u16 reg)
-{
-	return HFA384X_INW(reg);
-}
-
-
 static void hfa384x_read_regs(struct net_device *dev,
 			      struct hfa384x_regs *regs)
 {
@@ -2897,7 +2890,12 @@ static void hostap_tick_timer(struct timer_list *t)
 }
 
 
-#ifndef PRISM2_NO_PROCFS_DEBUG
+#if !defined(PRISM2_NO_PROCFS_DEBUG) && defined(CONFIG_PROC_FS)
+static u16 hfa384x_read_reg(struct net_device *dev, u16 reg)
+{
+	return HFA384X_INW(reg);
+}
+
 static int prism2_registers_proc_show(struct seq_file *m, void *v)
 {
 	local_info_t *local = m->private;
@@ -2951,8 +2949,7 @@ static int prism2_registers_proc_show(struct seq_file *m, void *v)
 
 	return 0;
 }
-#endif /* PRISM2_NO_PROCFS_DEBUG */
-
+#endif
 
 struct set_tim_data {
 	struct list_head list;
diff --git a/drivers/net/wireless/intersil/hostap/hostap_proc.c b/drivers/net/wireless/intersil/hostap/hostap_proc.c
index 5b33cca..703d74c 100644
--- a/drivers/net/wireless/intersil/hostap/hostap_proc.c
+++ b/drivers/net/wireless/intersil/hostap/hostap_proc.c
@@ -11,8 +11,7 @@
 
 #define PROC_LIMIT (PAGE_SIZE - 80)
 
-
-#ifndef PRISM2_NO_PROCFS_DEBUG
+#if !defined(PRISM2_NO_PROCFS_DEBUG) && defined(CONFIG_PROC_FS)
 static int prism2_debug_proc_show(struct seq_file *m, void *v)
 {
 	local_info_t *local = m->private;
@@ -43,9 +42,9 @@ static int prism2_debug_proc_show(struct seq_file *m, void *v)
 
 	return 0;
 }
-#endif /* PRISM2_NO_PROCFS_DEBUG */
-
+#endif
 
+#ifdef CONFIG_PROC_FS
 static int prism2_stats_proc_show(struct seq_file *m, void *v)
 {
 	local_info_t *local = m->private;
@@ -82,6 +81,7 @@ static int prism2_stats_proc_show(struct seq_file *m, void *v)
 
 	return 0;
 }
+#endif
 
 static int prism2_wds_proc_show(struct seq_file *m, void *v)
 {
@@ -174,6 +174,7 @@ static const struct seq_operations prism2_bss_list_proc_seqops = {
 	.show	= prism2_bss_list_proc_show,
 };
 
+#ifdef CONFIG_PROC_FS
 static int prism2_crypt_proc_show(struct seq_file *m, void *v)
 {
 	local_info_t *local = m->private;
@@ -190,6 +191,7 @@ static int prism2_crypt_proc_show(struct seq_file *m, void *v)
 	}
 	return 0;
 }
+#endif
 
 static ssize_t prism2_pda_proc_read(struct file *file, char __user *buf,
 				    size_t count, loff_t *_pos)
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] hostap: hide unused procfs helpers
@ 2018-07-13  7:26   ` Arend van Spriel
  0 siblings, 0 replies; 10+ messages in thread
From: Arend van Spriel @ 2018-07-13  7:26 UTC (permalink / raw)
  To: YueHaibing, j, kvalo
  Cc: linux-kernel, netdev, linux-wireless, davem, Randy Dunlap

+ Randy

On 7/13/2018 9:03 AM, YueHaibing wrote:
> When CONFIG_PROC_FS isn't set, gcc warning this:
>
> drivers/net/wireless/intersil/hostap/hostap_hw.c:2901:12: warning: ‘prism2_registers_proc_show’ defined but not used [-Wunused-function]
>   static int prism2_registers_proc_show(struct seq_file *m, void *v)
>
> drivers/net/wireless/intersil/hostap/hostap_proc.c:16:12: warning: ‘prism2_debug_proc_show’ defined but not used [-Wunused-function]
>   static int prism2_debug_proc_show(struct seq_file *m, void *v)
>              ^
> drivers/net/wireless/intersil/hostap/hostap_proc.c:49:12: warning: ‘prism2_stats_proc_show’ defined but not used [-Wunused-function]
>   static int prism2_stats_proc_show(struct seq_file *m, void *v)
>              ^
> drivers/net/wireless/intersil/hostap/hostap_proc.c:177:12: warning: ‘prism2_crypt_proc_show’ defined but not used [-Wunused-function]
>   static int prism2_crypt_proc_show(struct seq_file *m, void *v)
>              ^
>
> fix this by adding #ifdef around them.
> hfa384x_read_reg is only used by prism2_registers_proc_show,so move it
> into #ifdef.

There was already a fix for this posted by Randy Dunlap taking a 
different approach, ie. use __maybe_unused classifier. To be honest I 
prefer the ifdef approach as it is more explicit and does not feel like 
a cheat.

Actually some of the functions are between a flag already 
PRISM2_NO_PROCFS_DEBUG which is in a private header file 
hostap_config.h. Seems like this would be better placed in Kconfig and 
depend on CONFIG_PROCFS. Anyway, this driver is old cruft. Maybe some 
people are still running it, but it is probably not worth the effort so 
fine with either fix.

Regards,
Arend

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] hostap: hide unused procfs helpers
@ 2018-07-13  7:26   ` Arend van Spriel
  0 siblings, 0 replies; 10+ messages in thread
From: Arend van Spriel @ 2018-07-13  7:26 UTC (permalink / raw)
  To: YueHaibing, j, kvalo-sgV2jX0FEOL9JmXXK+q4OQ
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q, Randy Dunlap

+ Randy

On 7/13/2018 9:03 AM, YueHaibing wrote:
> When CONFIG_PROC_FS isn't set, gcc warning this:
>
> drivers/net/wireless/intersil/hostap/hostap_hw.c:2901:12: warning: ‘prism2_registers_proc_show’ defined but not used [-Wunused-function]
>   static int prism2_registers_proc_show(struct seq_file *m, void *v)
>
> drivers/net/wireless/intersil/hostap/hostap_proc.c:16:12: warning: ‘prism2_debug_proc_show’ defined but not used [-Wunused-function]
>   static int prism2_debug_proc_show(struct seq_file *m, void *v)
>              ^
> drivers/net/wireless/intersil/hostap/hostap_proc.c:49:12: warning: ‘prism2_stats_proc_show’ defined but not used [-Wunused-function]
>   static int prism2_stats_proc_show(struct seq_file *m, void *v)
>              ^
> drivers/net/wireless/intersil/hostap/hostap_proc.c:177:12: warning: ‘prism2_crypt_proc_show’ defined but not used [-Wunused-function]
>   static int prism2_crypt_proc_show(struct seq_file *m, void *v)
>              ^
>
> fix this by adding #ifdef around them.
> hfa384x_read_reg is only used by prism2_registers_proc_show,so move it
> into #ifdef.

There was already a fix for this posted by Randy Dunlap taking a 
different approach, ie. use __maybe_unused classifier. To be honest I 
prefer the ifdef approach as it is more explicit and does not feel like 
a cheat.

Actually some of the functions are between a flag already 
PRISM2_NO_PROCFS_DEBUG which is in a private header file 
hostap_config.h. Seems like this would be better placed in Kconfig and 
depend on CONFIG_PROCFS. Anyway, this driver is old cruft. Maybe some 
people are still running it, but it is probably not worth the effort so 
fine with either fix.

Regards,
Arend

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] hostap: hide unused procfs helpers
  2018-07-13  7:26   ` Arend van Spriel
  (?)
@ 2018-07-13  9:37   ` YueHaibing
  -1 siblings, 0 replies; 10+ messages in thread
From: YueHaibing @ 2018-07-13  9:37 UTC (permalink / raw)
  To: Arend van Spriel, j, kvalo
  Cc: linux-kernel, netdev, linux-wireless, davem, Randy Dunlap


On 2018/7/13 15:26, Arend van Spriel wrote:
> + Randy
> 
> On 7/13/2018 9:03 AM, YueHaibing wrote:
>> When CONFIG_PROC_FS isn't set, gcc warning this:
>>
>> drivers/net/wireless/intersil/hostap/hostap_hw.c:2901:12: warning: ‘prism2_registers_proc_show’ defined but not used [-Wunused-function]
>>   static int prism2_registers_proc_show(struct seq_file *m, void *v)
>>
>> drivers/net/wireless/intersil/hostap/hostap_proc.c:16:12: warning: ‘prism2_debug_proc_show’ defined but not used [-Wunused-function]
>>   static int prism2_debug_proc_show(struct seq_file *m, void *v)
>>              ^
>> drivers/net/wireless/intersil/hostap/hostap_proc.c:49:12: warning: ‘prism2_stats_proc_show’ defined but not used [-Wunused-function]
>>   static int prism2_stats_proc_show(struct seq_file *m, void *v)
>>              ^
>> drivers/net/wireless/intersil/hostap/hostap_proc.c:177:12: warning: ‘prism2_crypt_proc_show’ defined but not used [-Wunused-function]
>>   static int prism2_crypt_proc_show(struct seq_file *m, void *v)
>>              ^
>>
>> fix this by adding #ifdef around them.
>> hfa384x_read_reg is only used by prism2_registers_proc_show,so move it
>> into #ifdef.
> 
> There was already a fix for this posted by Randy Dunlap taking a different approach, ie. use __maybe_unused classifier. To be honest I prefer the ifdef approach as it is more explicit and does not feel like a cheat.
> 
> Actually some of the functions are between a flag already PRISM2_NO_PROCFS_DEBUG which is in a private header file hostap_config.h. Seems like this would be better placed in Kconfig and depend on CONFIG_PROCFS. Anyway, this driver is old cruft. Maybe some people are still running it, but it is probably not worth the effort so fine with either fix.
> 

I dont check Randy's patch. ignore this pls.

> Regards,
> Arend
> 
> .
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] hostap: hide unused procfs helpers
  2018-07-13  7:26   ` Arend van Spriel
  (?)
  (?)
@ 2018-07-13 16:43   ` Randy Dunlap
  -1 siblings, 0 replies; 10+ messages in thread
From: Randy Dunlap @ 2018-07-13 16:43 UTC (permalink / raw)
  To: Arend van Spriel, YueHaibing, j, kvalo
  Cc: linux-kernel, netdev, linux-wireless, davem

On 07/13/2018 12:26 AM, Arend van Spriel wrote:
> + Randy
> 
> On 7/13/2018 9:03 AM, YueHaibing wrote:
>> When CONFIG_PROC_FS isn't set, gcc warning this:
>>
>> drivers/net/wireless/intersil/hostap/hostap_hw.c:2901:12: warning: ‘prism2_registers_proc_show’ defined but not used [-Wunused-function]
>>   static int prism2_registers_proc_show(struct seq_file *m, void *v)
>>
>> drivers/net/wireless/intersil/hostap/hostap_proc.c:16:12: warning: ‘prism2_debug_proc_show’ defined but not used [-Wunused-function]
>>   static int prism2_debug_proc_show(struct seq_file *m, void *v)
>>              ^
>> drivers/net/wireless/intersil/hostap/hostap_proc.c:49:12: warning: ‘prism2_stats_proc_show’ defined but not used [-Wunused-function]
>>   static int prism2_stats_proc_show(struct seq_file *m, void *v)
>>              ^
>> drivers/net/wireless/intersil/hostap/hostap_proc.c:177:12: warning: ‘prism2_crypt_proc_show’ defined but not used [-Wunused-function]
>>   static int prism2_crypt_proc_show(struct seq_file *m, void *v)
>>              ^
>>
>> fix this by adding #ifdef around them.
>> hfa384x_read_reg is only used by prism2_registers_proc_show,so move it
>> into #ifdef.
> 
> There was already a fix for this posted by Randy Dunlap taking a different approach, ie. use __maybe_unused classifier. To be honest I prefer the ifdef approach as it is more explicit and does not feel like a cheat.

Hi,
You are welcome to merge (or ack or have someone else merge) either of them.
I'm not counting patches, just trying to help out (in this case by reducing noise).



> Actually some of the functions are between a flag already PRISM2_NO_PROCFS_DEBUG which is in a private header file hostap_config.h. Seems like this would be better placed in Kconfig and depend on CONFIG_PROCFS. Anyway, this driver is old cruft. Maybe some people are still running it, but it is probably not worth the effort so fine with either fix.
> 
> Regards,
> Arend


-- 
~Randy

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] hostap: hide unused procfs helpers
  2018-07-13  7:26   ` Arend van Spriel
@ 2018-07-27  9:25     ` Kalle Valo
  -1 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2018-07-27  9:25 UTC (permalink / raw)
  To: Arend van Spriel
  Cc: YueHaibing, j, linux-kernel, netdev, linux-wireless, davem, Randy Dunlap

Arend van Spriel <arend.vanspriel@broadcom.com> writes:

> + Randy
>
> On 7/13/2018 9:03 AM, YueHaibing wrote:
>> When CONFIG_PROC_FS isn't set, gcc warning this:
>>
>> drivers/net/wireless/intersil/hostap/hostap_hw.c:2901:12: warning: =E2=
=80=98prism2_registers_proc_show=E2=80=99 defined but not used [-Wunused-fu=
nction]
>>   static int prism2_registers_proc_show(struct seq_file *m, void *v)
>>
>> drivers/net/wireless/intersil/hostap/hostap_proc.c:16:12: warning: =E2=
=80=98prism2_debug_proc_show=E2=80=99 defined but not used [-Wunused-functi=
on]
>>   static int prism2_debug_proc_show(struct seq_file *m, void *v)
>>              ^
>> drivers/net/wireless/intersil/hostap/hostap_proc.c:49:12: warning: =E2=
=80=98prism2_stats_proc_show=E2=80=99 defined but not used [-Wunused-functi=
on]
>>   static int prism2_stats_proc_show(struct seq_file *m, void *v)
>>              ^
>> drivers/net/wireless/intersil/hostap/hostap_proc.c:177:12: warning: =E2=
=80=98prism2_crypt_proc_show=E2=80=99 defined but not used [-Wunused-functi=
on]
>>   static int prism2_crypt_proc_show(struct seq_file *m, void *v)
>>              ^
>>
>> fix this by adding #ifdef around them.
>> hfa384x_read_reg is only used by prism2_registers_proc_show,so move it
>> into #ifdef.
>
> There was already a fix for this posted by Randy Dunlap taking a
> different approach, ie. use __maybe_unused classifier. To be honest I
> prefer the ifdef approach as it is more explicit and does not feel
> like a cheat.

I also prefer the ifdef approach more so I'm planning to take this
patch.

--=20
Kalle Valo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] hostap: hide unused procfs helpers
@ 2018-07-27  9:25     ` Kalle Valo
  0 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2018-07-27  9:25 UTC (permalink / raw)
  To: Arend van Spriel
  Cc: YueHaibing, j, linux-kernel, netdev, linux-wireless, davem, Randy Dunlap

Arend van Spriel <arend.vanspriel@broadcom.com> writes:

> + Randy
>
> On 7/13/2018 9:03 AM, YueHaibing wrote:
>> When CONFIG_PROC_FS isn't set, gcc warning this:
>>
>> drivers/net/wireless/intersil/hostap/hostap_hw.c:2901:12: warning: ‘prism2_registers_proc_show’ defined but not used [-Wunused-function]
>>   static int prism2_registers_proc_show(struct seq_file *m, void *v)
>>
>> drivers/net/wireless/intersil/hostap/hostap_proc.c:16:12: warning: ‘prism2_debug_proc_show’ defined but not used [-Wunused-function]
>>   static int prism2_debug_proc_show(struct seq_file *m, void *v)
>>              ^
>> drivers/net/wireless/intersil/hostap/hostap_proc.c:49:12: warning: ‘prism2_stats_proc_show’ defined but not used [-Wunused-function]
>>   static int prism2_stats_proc_show(struct seq_file *m, void *v)
>>              ^
>> drivers/net/wireless/intersil/hostap/hostap_proc.c:177:12: warning: ‘prism2_crypt_proc_show’ defined but not used [-Wunused-function]
>>   static int prism2_crypt_proc_show(struct seq_file *m, void *v)
>>              ^
>>
>> fix this by adding #ifdef around them.
>> hfa384x_read_reg is only used by prism2_registers_proc_show,so move it
>> into #ifdef.
>
> There was already a fix for this posted by Randy Dunlap taking a
> different approach, ie. use __maybe_unused classifier. To be honest I
> prefer the ifdef approach as it is more explicit and does not feel
> like a cheat.

I also prefer the ifdef approach more so I'm planning to take this
patch.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] hostap: hide unused procfs helpers
  2018-07-27  9:25     ` Kalle Valo
  (?)
@ 2018-07-27 10:03     ` YueHaibing
  2018-07-27 15:46       ` Randy Dunlap
  -1 siblings, 1 reply; 10+ messages in thread
From: YueHaibing @ 2018-07-27 10:03 UTC (permalink / raw)
  To: Kalle Valo, Arend van Spriel
  Cc: j, linux-kernel, netdev, linux-wireless, davem, Randy Dunlap

On 2018/7/27 17:25, Kalle Valo wrote:
> Arend van Spriel <arend.vanspriel@broadcom.com> writes:
> 
>> + Randy
>>
>> On 7/13/2018 9:03 AM, YueHaibing wrote:
>>> When CONFIG_PROC_FS isn't set, gcc warning this:
>>>
>>> drivers/net/wireless/intersil/hostap/hostap_hw.c:2901:12: warning: ‘prism2_registers_proc_show’ defined but not used [-Wunused-function]
>>>   static int prism2_registers_proc_show(struct seq_file *m, void *v)
>>>
>>> drivers/net/wireless/intersil/hostap/hostap_proc.c:16:12: warning: ‘prism2_debug_proc_show’ defined but not used [-Wunused-function]
>>>   static int prism2_debug_proc_show(struct seq_file *m, void *v)
>>>              ^
>>> drivers/net/wireless/intersil/hostap/hostap_proc.c:49:12: warning: ‘prism2_stats_proc_show’ defined but not used [-Wunused-function]
>>>   static int prism2_stats_proc_show(struct seq_file *m, void *v)
>>>              ^
>>> drivers/net/wireless/intersil/hostap/hostap_proc.c:177:12: warning: ‘prism2_crypt_proc_show’ defined but not used [-Wunused-function]
>>>   static int prism2_crypt_proc_show(struct seq_file *m, void *v)
>>>              ^
>>>
>>> fix this by adding #ifdef around them.
>>> hfa384x_read_reg is only used by prism2_registers_proc_show,so move it
>>> into #ifdef.
>>
>> There was already a fix for this posted by Randy Dunlap taking a
>> different approach, ie. use __maybe_unused classifier. To be honest I
>> prefer the ifdef approach as it is more explicit and does not feel
>> like a cheat.
> 
> I also prefer the ifdef approach more so I'm planning to take this
> patch.

It's ok if you prefer pick this.

> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] hostap: hide unused procfs helpers
  2018-07-27 10:03     ` YueHaibing
@ 2018-07-27 15:46       ` Randy Dunlap
  0 siblings, 0 replies; 10+ messages in thread
From: Randy Dunlap @ 2018-07-27 15:46 UTC (permalink / raw)
  To: YueHaibing, Kalle Valo, Arend van Spriel
  Cc: j, linux-kernel, netdev, linux-wireless, davem

On 07/27/2018 03:03 AM, YueHaibing wrote:
> On 2018/7/27 17:25, Kalle Valo wrote:
>> Arend van Spriel <arend.vanspriel@broadcom.com> writes:
>>
>>> + Randy
>>>
>>> On 7/13/2018 9:03 AM, YueHaibing wrote:
>>>> When CONFIG_PROC_FS isn't set, gcc warning this:
>>>>
>>>> drivers/net/wireless/intersil/hostap/hostap_hw.c:2901:12: warning: ‘prism2_registers_proc_show’ defined but not used [-Wunused-function]
>>>>   static int prism2_registers_proc_show(struct seq_file *m, void *v)
>>>>
>>>> drivers/net/wireless/intersil/hostap/hostap_proc.c:16:12: warning: ‘prism2_debug_proc_show’ defined but not used [-Wunused-function]
>>>>   static int prism2_debug_proc_show(struct seq_file *m, void *v)
>>>>              ^
>>>> drivers/net/wireless/intersil/hostap/hostap_proc.c:49:12: warning: ‘prism2_stats_proc_show’ defined but not used [-Wunused-function]
>>>>   static int prism2_stats_proc_show(struct seq_file *m, void *v)
>>>>              ^
>>>> drivers/net/wireless/intersil/hostap/hostap_proc.c:177:12: warning: ‘prism2_crypt_proc_show’ defined but not used [-Wunused-function]
>>>>   static int prism2_crypt_proc_show(struct seq_file *m, void *v)
>>>>              ^
>>>>
>>>> fix this by adding #ifdef around them.
>>>> hfa384x_read_reg is only used by prism2_registers_proc_show,so move it
>>>> into #ifdef.
>>>
>>> There was already a fix for this posted by Randy Dunlap taking a
>>> different approach, ie. use __maybe_unused classifier. To be honest I
>>> prefer the ifdef approach as it is more explicit and does not feel
>>> like a cheat.
>>
>> I also prefer the ifdef approach more so I'm planning to take this
>> patch.
> 
> It's ok if you prefer pick this.

Right.

-- 
~Randy

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] hostap: hide unused procfs helpers
  2018-07-13  7:03 [PATCH] hostap: hide unused procfs helpers YueHaibing
  2018-07-13  7:26   ` Arend van Spriel
@ 2018-07-31  7:21 ` Kalle Valo
  1 sibling, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2018-07-31  7:21 UTC (permalink / raw)
  To: YueHaibing; +Cc: j, linux-kernel, netdev, linux-wireless, davem, YueHaibing

YueHaibing <yuehaibing@huawei.com> wrote:

> When CONFIG_PROC_FS isn't set, gcc warning this:
> 
> drivers/net/wireless/intersil/hostap/hostap_hw.c:2901:12: warning: ‘prism2_registers_proc_show’ defined but not used [-Wunused-function]
>  static int prism2_registers_proc_show(struct seq_file *m, void *v)
> 
> drivers/net/wireless/intersil/hostap/hostap_proc.c:16:12: warning: ‘prism2_debug_proc_show’ defined but not used [-Wunused-function]
>  static int prism2_debug_proc_show(struct seq_file *m, void *v)
>             ^
> drivers/net/wireless/intersil/hostap/hostap_proc.c:49:12: warning: ‘prism2_stats_proc_show’ defined but not used [-Wunused-function]
>  static int prism2_stats_proc_show(struct seq_file *m, void *v)
>             ^
> drivers/net/wireless/intersil/hostap/hostap_proc.c:177:12: warning: ‘prism2_crypt_proc_show’ defined but not used [-Wunused-function]
>  static int prism2_crypt_proc_show(struct seq_file *m, void *v)
>             ^
> 
> fix this by adding #ifdef around them.
> hfa384x_read_reg is only used by prism2_registers_proc_show,so move it
> into #ifdef.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Patch applied to wireless-drivers-next.git, thanks.

6ade689711ee hostap: hide unused procfs helpers

-- 
https://patchwork.kernel.org/patch/10522651/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-07-31  9:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-13  7:03 [PATCH] hostap: hide unused procfs helpers YueHaibing
2018-07-13  7:26 ` Arend van Spriel
2018-07-13  7:26   ` Arend van Spriel
2018-07-13  9:37   ` YueHaibing
2018-07-13 16:43   ` Randy Dunlap
2018-07-27  9:25   ` Kalle Valo
2018-07-27  9:25     ` Kalle Valo
2018-07-27 10:03     ` YueHaibing
2018-07-27 15:46       ` Randy Dunlap
2018-07-31  7:21 ` Kalle Valo

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.