[2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default

Message ID 20180524120300.15829-3-sw@simonwunderlich.de (mailing list archive)
State Not Applicable, archived
Delegated to: Simon Wunderlich
Headers
Series [1/8] batman-adv: Start new development cycle |

Commit Message

Simon Wunderlich May 24, 2018, 12:02 p.m. UTC
  From: Sven Eckelmann <sven@narfation.org>

All tools which were known to the batman-adv development team are
supporting the batman-adv netlink interface since a while. Also debugfs is
not supported for batman-adv interfaces in any non-default netns. Thus
disabling CONFIG_BATMAN_ADV_DEBUGFS by default should not cause problems on
most systems. It is still possible to enable it in case it is still
required in a specific setup.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Sergei Shtylyov May 25, 2018, 10:33 a.m. UTC | #1
Hello!

On 5/24/2018 3:02 PM, Simon Wunderlich wrote:

> From: Sven Eckelmann <sven@narfation.org>
> 
> All tools which were known to the batman-adv development team are
> supporting the batman-adv netlink interface since a while. Also debugfs is
> not supported for batman-adv interfaces in any non-default netns. Thus
> disabling CONFIG_BATMAN_ADV_DEBUGFS by default should not cause problems on
> most systems. It is still possible to enable it in case it is still
> required in a specific setup.
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
> ---
>   net/batman-adv/Kconfig | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig
> index e4e2e02b7380..bee034a95208 100644
> --- a/net/batman-adv/Kconfig
> +++ b/net/batman-adv/Kconfig
> @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
>   	bool "batman-adv debugfs entries"
>   	depends on BATMAN_ADV
>   	depends on DEBUG_FS
> -	default y
> +	default n

    N is the default default. :-) You don't need this line.

[...]

MBR, Sergei
  
Sven Eckelmann May 25, 2018, 10:50 a.m. UTC | #2
On Freitag, 25. Mai 2018 13:33:59 CEST Sergei Shtylyov wrote:
[...]
> > --- a/net/batman-adv/Kconfig
> > +++ b/net/batman-adv/Kconfig
> > @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
> > bool "batman-adv debugfs entries"
> > depends on BATMAN_ADV
> > depends on DEBUG_FS
> > -       default y
> > +       default n
> 
>     N is the default default. :-) You don't need this line.

Hm, looks like this would have to be changed in a lot of places (~782 
according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
next). Do you want to fix it everywhere? Might be good to get this integrated 
in checkpatch.pl when this will become a new policy.

Kind regards,
	Sven
  
Sergei Shtylyov May 25, 2018, 11:13 a.m. UTC | #3
On 5/25/2018 1:50 PM, Sven Eckelmann wrote:

> [...]
>>> --- a/net/batman-adv/Kconfig
>>> +++ b/net/batman-adv/Kconfig
>>> @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
>>> bool "batman-adv debugfs entries"
>>> depends on BATMAN_ADV
>>> depends on DEBUG_FS
>>> -       default y
>>> +       default n
>>
>>      N is the default default. :-) You don't need this line.
> 
> Hm, looks like this would have to be changed in a lot of places (~782
> according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
> next). Do you want to fix it everywhere?

    No, but we can at least not add the new ones...

> Might be good to get this integrated
> in checkpatch.pl when this will become a new policy.

    Adding Joe Perches. Joe, can you add a check for "default n"?

> Kind regards,
> 	Sven

MBR, Sergei
  
Sven Eckelmann May 25, 2018, 11:15 a.m. UTC | #4
On Freitag, 25. Mai 2018 14:13:40 CEST Sergei Shtylyov wrote:
> > [...]
> >>> --- a/net/batman-adv/Kconfig
> >>> +++ b/net/batman-adv/Kconfig
> >>> @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
> >>> bool "batman-adv debugfs entries"
> >>> depends on BATMAN_ADV
> >>> depends on DEBUG_FS
> >>> -       default y
> >>> +       default n
> >>
> >> N is the default default. :-) You don't need this line.
> >
> > Hm, looks like this would have to be changed in a lot of places (~782
> > according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
> > next). Do you want to fix it everywhere?
> 
>     No, but we can at least not add the new ones...

But the patch was added to net-next yesterday.

Kind regards,
	Sven
  
Sergei Shtylyov May 25, 2018, 3:56 p.m. UTC | #5
On 05/25/2018 02:15 PM, Sven Eckelmann wrote:

>>> [...]
>>>>> --- a/net/batman-adv/Kconfig
>>>>> +++ b/net/batman-adv/Kconfig
>>>>> @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
>>>>> bool "batman-adv debugfs entries"
>>>>> depends on BATMAN_ADV
>>>>> depends on DEBUG_FS
>>>>> -       default y
>>>>> +       default n
>>>>
>>>> N is the default default. :-) You don't need this line.
>>>
>>> Hm, looks like this would have to be changed in a lot of places (~782
>>> according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
>>> next). Do you want to fix it everywhere?
>>
>>     No, but we can at least not add the new ones...
> 
> But the patch was added to net-next yesterday.

   DaveM is still too fast for me. :-)

> Kind regards,
> 	Sven

MBR, Sergei
  
Joe Perches May 25, 2018, 6:20 p.m. UTC | #6
On Fri, 2018-05-25 at 14:13 +0300, Sergei Shtylyov wrote:
> On 5/25/2018 1:50 PM, Sven Eckelmann wrote:
> 
> > [...]
> > > > --- a/net/batman-adv/Kconfig
> > > > +++ b/net/batman-adv/Kconfig
> > > > @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
> > > > bool "batman-adv debugfs entries"
> > > > depends on BATMAN_ADV
> > > > depends on DEBUG_FS
> > > > -       default y
> > > > +       default n
> > > 
> > >      N is the default default. :-) You don't need this line.
> > 
> > Hm, looks like this would have to be changed in a lot of places (~782
> > according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
> > next). Do you want to fix it everywhere?
> 
>     No, but we can at least not add the new ones...
> 
> > Might be good to get this integrated
> > in checkpatch.pl when this will become a new policy.
> 
>     Adding Joe Perches. Joe, can you add a check for "default n"?

OK.

This also improves the Kconfig boolean->bool test above
as it's broken for multiple section Kconfig files with
help texts.
---
 scripts/checkpatch.pl | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index baddac9379f0..1f980be4950b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2888,9 +2888,22 @@ sub process {
 
 # discourage the use of boolean for type definition attributes of Kconfig options
 		if ($realfile =~ /Kconfig/ &&
-		    $line =~ /^\+\s*\bboolean\b/) {
-			WARN("CONFIG_TYPE_BOOLEAN",
-			     "Use of boolean is deprecated, please use bool instead.\n" . $herecurr);
+		    $rawline =~ /^\+\s*\bboolean\b/) {
+			if (WARN("CONFIG_TYPE_BOOLEAN",
+				 "Use of boolean is deprecated, please use bool instead.\n" . $herecurr) &&
+			    $fix) {
+				$fixed[$fixlinenr] =~ s/\bboolean\b/bool/;
+			}
+		}
+
+# discourage the use of 'default n' in Kconfig files as that's the default
+		if ($realfile =~ /Kconfig/ &&
+		    $rawline =~ /^\+\s*default\s+n\s*$/) {
+			if (WARN("CONFIG_DEFAULT_N",
+				 "Unnecessary Use of 'default n'\n" . $herecurr) &&
+			    $fix) {
+				fix_delete_line($fixlinenr, $rawline);
+			}
 		}
 
 		if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) &&
  
David Miller May 25, 2018, 6:39 p.m. UTC | #7
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Fri, 25 May 2018 18:56:09 +0300

> On 05/25/2018 02:15 PM, Sven Eckelmann wrote:
> 
>>>> [...]
>>>>>> --- a/net/batman-adv/Kconfig
>>>>>> +++ b/net/batman-adv/Kconfig
>>>>>> @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
>>>>>> bool "batman-adv debugfs entries"
>>>>>> depends on BATMAN_ADV
>>>>>> depends on DEBUG_FS
>>>>>> -       default y
>>>>>> +       default n
>>>>>
>>>>> N is the default default. :-) You don't need this line.
>>>>
>>>> Hm, looks like this would have to be changed in a lot of places (~782
>>>> according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
>>>> next). Do you want to fix it everywhere?
>>>
>>>     No, but we can at least not add the new ones...
>> 
>> But the patch was added to net-next yesterday.
> 
>    DaveM is still too fast for me. :-)

No worries, just let's get a patch to remove the line.
  

Patch

diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig
index e4e2e02b7380..bee034a95208 100644
--- a/net/batman-adv/Kconfig
+++ b/net/batman-adv/Kconfig
@@ -94,13 +94,13 @@  config BATMAN_ADV_DEBUGFS
 	bool "batman-adv debugfs entries"
 	depends on BATMAN_ADV
 	depends on DEBUG_FS
-	default y
+	default n
 	help
 	  Enable this to export routing related debug tables via debugfs.
 	  The information for each soft-interface and used hard-interface can be
 	  found under batman_adv/
 
-	  If unsure, say Y.
+	  If unsure, say N.
 
 config BATMAN_ADV_DEBUG
 	bool "B.A.T.M.A.N. debugging"