public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Opdenacker <michael.opdenacker@free-electrons.com>
To: Joe Perches <joe@perches.com>
Cc: mmarek@suse.cz, yann.morin.1998@free.fr,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scripts/checkkconfig.py: find unused Kconfig parameters
Date: Fri, 25 Oct 2013 15:38:52 +0200	[thread overview]
Message-ID: <526A746C.3060806@free-electrons.com> (raw)
In-Reply-To: <1382599849.22433.51.camel@joe-AO722>

Hi Joe,

Thank you very much for your review!

On 10/24/2013 09:30 AM, Joe Perches wrote:
> On Thu, 2013-10-24 at 07:23 +0200, Michael Opdenacker wrote:
>
>> +def count_param(param):
>> +
>> +    global source_file, bad_params_in_file
>> +
>> +    if os.path.isdir('.git'):
>> +       # Use git grep when available
>> +       count = subprocess.check_output('git grep ' + param + '| grep -v defconfig | wc -l', shell=True)
>> +    else:
>> +       # Fallback to regular grep
>> +       count = subprocess.check_output('grep -R ' + param + ' . | grep -v defconfig | wc -l', shell=True)
> Doesn't the grep need -w?
Using "-w" is a good idea, and this way I can eliminate false negatives
(for example finding matches for "PRINTK_TIME" when I'm looking for
plain "PRINTK"). The only this is that I then need to look for both
"PARAM" (in Kconfig files, in case the parameter is just used for
dependency management), and for "CONFIG_PARAM" (in source files).
>
> Also, the regular grep could probably use something like
> 'grep -R -w --max-count=2 --include="*.[chS]"'
I can definitely use "--max-count=2".

 '--include="*.[chS]"' is more problematic because it excludes Kconfig
files. I'll use "-I" instead to just ignore binary files.

I'll soon send an update taking this into account.

Don't hesitate to send more comments.

Thanks again,

Michael.

-- 
Michael Opdenacker, CEO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
+33 484 258 098


  reply	other threads:[~2013-10-25 13:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24  5:23 [PATCH] scripts/checkkconfig.py: find unused Kconfig parameters Michael Opdenacker
2013-10-24  7:30 ` Joe Perches
2013-10-25 13:38   ` Michael Opdenacker [this message]
2013-10-25 13:45     ` Michal Marek
2013-10-30  3:07       ` Michael Opdenacker
2013-10-24  9:39 ` Michal Marek
2013-10-29 18:06 ` Yann E. MORIN
2013-10-30  3:14   ` Michael Opdenacker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=526A746C.3060806@free-electrons.com \
    --to=michael.opdenacker@free-electrons.com \
    --cc=akpm@linux-foundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=yann.morin.1998@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox