All of lore.kernel.org
 help / color / mirror / Atom feed
* almost time to run my kernel source cleaning scripts again?
@ 2012-04-11 21:07 Robert P. J. Day
  2012-04-11 21:52 ` Jesper Juhl
  2012-04-11 22:43 ` David Daney
  0 siblings, 2 replies; 5+ messages in thread
From: Robert P. J. Day @ 2012-04-11 21:07 UTC (permalink / raw)
  To: Linux Kernel Mailing List


  it's been a while so i was thinking of firing up my scripts to
peruse the source tree looking for oddities/inconsistencies/whatever
(unless someone else is already doing that).

  one example is looking for preprocessor tests of symbols that aren't
defined in any Kconfig file, and i can focus on any part of the source
tree.  for example, if i run that script against drivers/mmc, i get:

>>>>> MMC_MSM7X00A_RESUME_IN_WQ
drivers/mmc/host/msm_sdcc.c:1408:#ifdef CONFIG_MMC_MSM7X00A_RESUME_IN_WQ

telling me that a source file is testing a CONFIG variable that
doesn't exist.

  the scripts are available online (maybe i better test them first),
so anyone's free to run them against any part of the tree they want.

  running this script against drivers/staging is always good for
entertainment:

>>>>> CAVIUM_OCTEON_NUM_PACKET_BUFFERS
drivers/staging/octeon/ethernet-defines.h:36: *  CONFIG_CAVIUM_OCTEON_NUM_PACKET_BUFFERS
drivers/staging/octeon/ethernet.c:56:#if defined(CONFIG_CAVIUM_OCTEON_NUM_PACKET_BUFFERS) \
drivers/staging/octeon/ethernet.c:57:	&& CONFIG_CAVIUM_OCTEON_NUM_PACKET_BUFFERS
drivers/staging/octeon/ethernet.c:58:int num_packet_buffers = CONFIG_CAVIUM_OCTEON_NUM_PACKET_BUFFERS;
>>>>> CONSOLE_115200
drivers/staging/serial/68360serial.c:310:#elif defined(CONFIG_CONSOLE_115200)
>>>>> CONSOLE_19200
drivers/staging/serial/68360serial.c:308:#elif defined(CONFIG_CONSOLE_19200)
>>>>> CONSOLE_9600
drivers/staging/serial/68360serial.c:306:#if defined(CONFIG_CONSOLE_9600)
>>>>> FORCE_HARD_FLOAT
drivers/staging/rtl8192u/r8192U_core.c:27:#ifndef CONFIG_FORCE_HARD_FLOAT
... lots more ...

  i'll make sure the scripts work and maybe let them loose to find
stuff in a day or two.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

* Re: almost time to run my kernel source cleaning scripts again?
  2012-04-11 21:07 almost time to run my kernel source cleaning scripts again? Robert P. J. Day
@ 2012-04-11 21:52 ` Jesper Juhl
  2012-04-11 22:12   ` Robert P. J. Day
  2012-04-11 22:43 ` David Daney
  1 sibling, 1 reply; 5+ messages in thread
From: Jesper Juhl @ 2012-04-11 21:52 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Linux Kernel Mailing List

On Wed, 11 Apr 2012, Robert P. J. Day wrote:

> 
>   it's been a while so i was thinking of firing up my scripts to
> peruse the source tree looking for oddities/inconsistencies/whatever
> (unless someone else is already doing that).
> 
>   one example is looking for preprocessor tests of symbols that aren't
> defined in any Kconfig file, and i can focus on any part of the source
> tree.  for example, if i run that script against drivers/mmc, i get:
> 
> >>>>> MMC_MSM7X00A_RESUME_IN_WQ
> drivers/mmc/host/msm_sdcc.c:1408:#ifdef CONFIG_MMC_MSM7X00A_RESUME_IN_WQ
> 
> telling me that a source file is testing a CONFIG variable that
> doesn't exist.
> 
>   the scripts are available online 

I'd be interrested in taking a look at those. Got a URL where I can grab 
them?


[...]

-- 
Jesper Juhl <jj@chaosbits.net>       http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.


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

* Re: almost time to run my kernel source cleaning scripts again?
  2012-04-11 21:52 ` Jesper Juhl
@ 2012-04-11 22:12   ` Robert P. J. Day
  0 siblings, 0 replies; 5+ messages in thread
From: Robert P. J. Day @ 2012-04-11 22:12 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: Linux Kernel Mailing List

On Wed, 11 Apr 2012, Jesper Juhl wrote:

> On Wed, 11 Apr 2012, Robert P. J. Day wrote:
>
> >
> >   it's been a while so i was thinking of firing up my scripts to
> > peruse the source tree looking for oddities/inconsistencies/whatever
> > (unless someone else is already doing that).
> >
> >   one example is looking for preprocessor tests of symbols that aren't
> > defined in any Kconfig file, and i can focus on any part of the source
> > tree.  for example, if i run that script against drivers/mmc, i get:
> >
> > >>>>> MMC_MSM7X00A_RESUME_IN_WQ
> > drivers/mmc/host/msm_sdcc.c:1408:#ifdef CONFIG_MMC_MSM7X00A_RESUME_IN_WQ
> >
> > telling me that a source file is testing a CONFIG variable that
> > doesn't exist.
> >
> >   the scripts are available online
>
> I'd be interrested in taking a look at those. Got a URL where I can grab
> them?

  as long as you promise not to snicker at them, here are my most
"popular" ones:

http://www.crashcourse.ca/wiki/index.php/Kernel_cleanup_scripts

  i typically used the word "unused" to refer to variables defined in
Kconfig files that simply aren't referenced anymore -- not fatal in
any sense, just leftover detritus when people removed code but forgot
to take out the corresponding Kconfig entry.

  i use the word "badref" for instances where a CONFIG_ variable *is*
tested in a source file, but doesn't exist in a Kconfig file -- that's
typically more serious.  or sometimes, it's just a typo.

  just now, i ran the "find_badref_configs" script against the entire
drivers/ directory -- first few lines of output were:

>>>>> ACORNSCSI_CONSTANTS
drivers/scsi/arm/acornscsi.c:106:#undef CONFIG_ACORNSCSI_CONSTANTS
drivers/scsi/arm/acornscsi.c:413:#ifdef CONFIG_ACORNSCSI_CONSTANTS
drivers/scsi/arm/acornscsi.c:491:#ifdef CONFIG_ACORNSCSI_CONSTANTS
... snip ...

which i recognize by now since that's been there, like, *forever*.

  anyway, feel free to play; i might do some tweaking on those over
the next few days.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

* Re: almost time to run my kernel source cleaning scripts again?
  2012-04-11 21:07 almost time to run my kernel source cleaning scripts again? Robert P. J. Day
  2012-04-11 21:52 ` Jesper Juhl
@ 2012-04-11 22:43 ` David Daney
  2012-04-12  0:46   ` Robert P. J. Day
  1 sibling, 1 reply; 5+ messages in thread
From: David Daney @ 2012-04-11 22:43 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Linux Kernel Mailing List

On 04/11/2012 02:07 PM, Robert P. J. Day wrote:
>
>    it's been a while so i was thinking of firing up my scripts to
> peruse the source tree looking for oddities/inconsistencies/whatever
> (unless someone else is already doing that).
>
>    one example is looking for preprocessor tests of symbols that aren't
> defined in any Kconfig file, and i can focus on any part of the source
> tree.  for example, if i run that script against drivers/mmc, i get:
[...]
>
>>>>>> CAVIUM_OCTEON_NUM_PACKET_BUFFERS
> drivers/staging/octeon/ethernet-defines.h:36: *  CONFIG_CAVIUM_OCTEON_NUM_PACKET_BUFFERS
> drivers/staging/octeon/ethernet.c:56:#if defined(CONFIG_CAVIUM_OCTEON_NUM_PACKET_BUFFERS) \
> drivers/staging/octeon/ethernet.c:57:	&&  CONFIG_CAVIUM_OCTEON_NUM_PACKET_BUFFERS
> drivers/staging/octeon/ethernet.c:58:int num_packet_buffers = CONFIG_CAVIUM_OCTEON_NUM_PACKET_BUFFERS;

I am aware of these and am working on fixing them.

Thanks,
David Daney

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

* Re: almost time to run my kernel source cleaning scripts again?
  2012-04-11 22:43 ` David Daney
@ 2012-04-12  0:46   ` Robert P. J. Day
  0 siblings, 0 replies; 5+ messages in thread
From: Robert P. J. Day @ 2012-04-12  0:46 UTC (permalink / raw)
  To: David Daney; +Cc: Linux Kernel Mailing List

On Wed, 11 Apr 2012, David Daney wrote:

> On 04/11/2012 02:07 PM, Robert P. J. Day wrote:
> >
> >    it's been a while so i was thinking of firing up my scripts to
> > peruse the source tree looking for oddities/inconsistencies/whatever
> > (unless someone else is already doing that).
> >
> >    one example is looking for preprocessor tests of symbols that aren't
> > defined in any Kconfig file, and i can focus on any part of the source
> > tree.  for example, if i run that script against drivers/mmc, i get:
> [...]
> >
> > > > > > > CAVIUM_OCTEON_NUM_PACKET_BUFFERS
> > drivers/staging/octeon/ethernet-defines.h:36: *
> > CONFIG_CAVIUM_OCTEON_NUM_PACKET_BUFFERS
> > drivers/staging/octeon/ethernet.c:56:#if
> > defined(CONFIG_CAVIUM_OCTEON_NUM_PACKET_BUFFERS) \
> > drivers/staging/octeon/ethernet.c:57:	&&
> > CONFIG_CAVIUM_OCTEON_NUM_PACKET_BUFFERS
> > drivers/staging/octeon/ethernet.c:58:int num_packet_buffers =
> > CONFIG_CAVIUM_OCTEON_NUM_PACKET_BUFFERS;
>
> I am aware of these and am working on fixing them.

  sorry, i wasn't trying to pick on anyone, it was just a random
example.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

end of thread, other threads:[~2012-04-12  0:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11 21:07 almost time to run my kernel source cleaning scripts again? Robert P. J. Day
2012-04-11 21:52 ` Jesper Juhl
2012-04-11 22:12   ` Robert P. J. Day
2012-04-11 22:43 ` David Daney
2012-04-12  0:46   ` Robert P. J. Day

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.