From: Robert P. J. Day <rpjday@crashcourse.ca>
To: u-boot@lists.denx.de
Subject: [U-Boot] policy regarding unused code
Date: Tue, 11 Dec 2018 14:24:35 -0500 (EST) [thread overview]
Message-ID: <alpine.LFD.2.21.1812111411540.4139@localhost.localdomain> (raw)
In-Reply-To: <20181211163552.GT8702@bill-the-cat>
On Tue, 11 Dec 2018, Tom Rini wrote:
... snip ...
> > This is not a small list and a lot of them we probably want to keep.
> >
> > ['CONFIG_MX8M', 'CONFIG_POWER_PMIC_MAX77693', 'CONFIG_TPM2_TIS_SANDBOX',
> > 'CONFIG_TPM_ST33ZP24_SPI', 'CONFIG_USB_SL811HS', 'CONFIG_RAM_SUPPORT',
> > 'CONFIG_BCM2835_WDT', 'CONFIG_ENV_IS_IN_SATA', 'CONFIG_IO64',
> > 'CONFIG_NAND_SUPPORT', 'CONFIG_NOR_SUPPORT', 'CONFIG_RISCV_ISA_A',
> > 'CONFIG_I2C_MUX_GPIO', 'CONFIG_POWER_FG_MAX17042', 'CONFIG_DNET',
> > 'CONFIG_CMD_SH_ZIMAGEBOOT', 'CONFIG_USE_DEFAULT_ENV_FILE',
> > 'CONFIG_CMD_IOTRACE', 'CONFIG_ALI152X', 'CONFIG_M5271',
> > 'CONFIG_CPU_MPC83XX', 'CONFIG_NXP_TDA19988', 'CONFIG_IMX',
... big snip ...
> I suspect this splits into three categories:
> - Dead symbols and code to drop.
> - Typos/thinkos
> - Mistake in your grep? I see CONFIG_VIRTIO_SANDBOX is used today for
> example.
what did you run to get that list of CONFIG_* symbols? years ago, i
wrote some scripts that scanned the linux source tree looking for
things like that; i just dragged that script out of mothballs and ran
it against the current u-boot tree and got over 4,500 lines of
output, but my script lists apparently unused CONFIG variables, then
does a recursive search against a given directory to show anywhere
that symbol shows up, a symbol at a time.
for example, my script for "badref" goes looking for CONFIG settings
that are being tested somewhere but that have no corresponding
"config" stanza in a Kconfig file somewhere.
$ find_badref_configs.sh drivers
the first few lines of output:
>>>>> ACX517AKN
drivers/video/pxa_lcd.c:201:#ifdef CONFIG_ACX517AKN
drivers/video/pxa_lcd.c:231:#endif /* CONFIG_ACX517AKN */
drivers/video/pxa_lcd.c:297:#endif /* CONFIG_ACX517AKN */
scripts/config_whitelist.txt:15:CONFIG_ACX517AKN
>>>>> ACX544AKN
drivers/video/pxa_lcd.c:233:#ifdef CONFIG_ACX544AKN
drivers/video/pxa_lcd.c:263:#endif /* CONFIG_ACX544AKN */
scripts/config_whitelist.txt:16:CONFIG_ACX544AKN
>>>>> ADNPESC1
drivers/net/smc91111.h:253:#ifdef CONFIG_ADNPESC1
drivers/net/smc91111.h:262:#ifdef CONFIG_ADNPESC1
drivers/net/smc91111.h:444:#elif defined(CONFIG_ADNPESC1)
scripts/config_whitelist.txt:20:CONFIG_ADNPESC1
... snip ...
as you can see, that shows that there is a CONFIG_ACX517AKN being
tested, while there is no apparent "config" definition for it
anywhere (not sure whether being in the whitelist.txt file means
anything relative to that). and so on, and so on.
i can see the OP's FPGA_LATTICE in my output:
>>>>> FPGA_LATTICE
drivers/fpga/Makefile:13:obj-$(CONFIG_FPGA_LATTICE) += ivm_core.o lattice.o
drivers/fpga/fpga.c:103:#if defined(CONFIG_FPGA_LATTICE)
drivers/fpga/fpga.c:276:#if defined(CONFIG_FPGA_LATTICE)
drivers/fpga/fpga.c:318:#if defined(CONFIG_FPGA_LATTICE)
which is clearly being tested, while never being defined. so, yes, my
script locates a *ton* of variables like that.
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca/dokuwiki
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
next prev parent reply other threads:[~2018-12-11 19:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-11 15:25 [U-Boot] policy regarding unused code Jean-Jacques Hiblot
2018-12-11 15:46 ` Jean-Jacques Hiblot
2018-12-11 16:35 ` Tom Rini
2018-12-11 17:01 ` Jean-Jacques Hiblot
2018-12-11 18:17 ` Tom Rini
2018-12-12 11:59 ` Jean-Jacques Hiblot
[not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FA3A5E60E@ATCPCS16.andestech.com>
2018-12-13 2:03 ` Rick Chen
2018-12-11 19:24 ` Robert P. J. Day [this message]
2018-12-12 15:17 ` Jean-Jacques Hiblot
2018-12-11 22:44 ` Lukasz Majewski
2018-12-14 15:54 ` Neil Armstrong
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=alpine.LFD.2.21.1812111411540.4139@localhost.localdomain \
--to=rpjday@crashcourse.ca \
--cc=u-boot@lists.denx.de \
/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 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.