* [PATCH 0/3] Removing dead code
@ 2010-07-21 12:34 Christian Dietrich
2010-07-21 12:35 ` [PATCH 1/3] sound/oss: Remove dead CONFIG_SOFTOSS* Christian Dietrich
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Christian Dietrich @ 2010-07-21 12:34 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai, Tejun Heo, Julia Lawall,
Liam Girdwood, Mark Brown, linux-kernel, alsa-devel
Cc: vamos-dev
Hi all!
As part of the VAMOS[0] research project at the University of
Erlangen we are looking at multiple integrity errors in linux'
configuration system.
I've been running a check on the sound/ sourcetree for
config Items not defined in Kconfig and found 3 such cases. Sourcecode
blocks depending on these Items are not reachable from a vanilla
kernel -- dead code. I've seen such dead blocks made on purpose
e.g. while integrating new features into the kernel but generally
they're just useless.
Each of the patches in this patchset removes on such dead
config Item, I'd be glad if you consider applying them. I've been
doing deeper analysis of such issues before and can do so again but
I'm not so sure they were fastly usefull.
I build the patches against a vanilla kernel in order to
try if the kernel compiles with this patches
Please keep me informed of this patch getting confirmed /
merged so we can keep track of it.
Regards
Christian Dietrich
[0] http://vamos1.informatik.uni-erlangen.de/
Christian Dietrich (3):
sound/oss: Remove dead CONFIG_SOFTOSS*
sound/soc/atmel: Remove dead CONFIG_AT32_ENHANCED_PORTMUX
sound/isa/gus: Remove dead CONFIG_SND_DEBUG_ROM
sound/isa/gus/interwave.c | 8 --------
sound/oss/vidc.c | 3 ---
sound/soc/atmel/playpaq_wm8510.c | 9 ---------
3 files changed, 0 insertions(+), 20 deletions(-)
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 1/3] sound/oss: Remove dead CONFIG_SOFTOSS* 2010-07-21 12:34 [PATCH 0/3] Removing dead code Christian Dietrich @ 2010-07-21 12:35 ` Christian Dietrich 2010-07-21 13:03 ` Takashi Iwai 2010-07-21 12:35 ` [PATCH 2/3] sound/soc/atmel: Remove dead CONFIG_AT32_ENHANCED_PORTMUX Christian Dietrich 2010-07-21 12:36 ` [PATCH 3/3] sound/isa/gus: Remove dead CONFIG_SND_DEBUG_ROM Christian Dietrich 2 siblings, 1 reply; 7+ messages in thread From: Christian Dietrich @ 2010-07-21 12:35 UTC (permalink / raw) To: Jaroslav Kysela, Takashi Iwai, Julia Lawall, Tejun Heo, linux-kernel, alsa-devel Cc: vamos-dev CONFIG_SOFTOSS* doesn't exist in Kconfig or somewhere else, therefore removing all references for it from the source code. Signed-off-by: Christian Dietrich <qy03fugy@stud.informatik.uni-erlangen.de> --- sound/oss/vidc.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/sound/oss/vidc.c b/sound/oss/vidc.c index ac39a53..f0e0caa 100644 --- a/sound/oss/vidc.c +++ b/sound/oss/vidc.c @@ -491,9 +491,6 @@ static void __init attach_vidc(struct address_info *hw_config) vidc_adev = adev; vidc_mixer_set(SOUND_MIXER_VOLUME, (85 | 85 << 8)); -#if defined(CONFIG_SOUND_SOFTOSS) || defined(CONFIG_SOUND_SOFTOSS_MODULE) - softoss_dev = adev; -#endif return; irq_failed: -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] sound/oss: Remove dead CONFIG_SOFTOSS* 2010-07-21 12:35 ` [PATCH 1/3] sound/oss: Remove dead CONFIG_SOFTOSS* Christian Dietrich @ 2010-07-21 13:03 ` Takashi Iwai 0 siblings, 0 replies; 7+ messages in thread From: Takashi Iwai @ 2010-07-21 13:03 UTC (permalink / raw) To: Christian Dietrich Cc: Jaroslav Kysela, Julia Lawall, Tejun Heo, linux-kernel, alsa-devel, vamos-dev At Wed, 21 Jul 2010 14:35:17 +0200, Christian Dietrich wrote: > > CONFIG_SOFTOSS* doesn't exist in Kconfig or somewhere > else, therefore removing all references for it from the source code. > > Signed-off-by: Christian Dietrich <qy03fugy@stud.informatik.uni-erlangen.de> Applied this one. Thanks. Takashi > --- > sound/oss/vidc.c | 3 --- > 1 files changed, 0 insertions(+), 3 deletions(-) > > diff --git a/sound/oss/vidc.c b/sound/oss/vidc.c > index ac39a53..f0e0caa 100644 > --- a/sound/oss/vidc.c > +++ b/sound/oss/vidc.c > @@ -491,9 +491,6 @@ static void __init attach_vidc(struct address_info *hw_config) > vidc_adev = adev; > vidc_mixer_set(SOUND_MIXER_VOLUME, (85 | 85 << 8)); > > -#if defined(CONFIG_SOUND_SOFTOSS) || defined(CONFIG_SOUND_SOFTOSS_MODULE) > - softoss_dev = adev; > -#endif > return; > > irq_failed: > -- > 1.7.0.4 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] sound/soc/atmel: Remove dead CONFIG_AT32_ENHANCED_PORTMUX 2010-07-21 12:34 [PATCH 0/3] Removing dead code Christian Dietrich 2010-07-21 12:35 ` [PATCH 1/3] sound/oss: Remove dead CONFIG_SOFTOSS* Christian Dietrich @ 2010-07-21 12:35 ` Christian Dietrich 2010-07-21 12:50 ` Mark Brown 2010-07-21 12:36 ` [PATCH 3/3] sound/isa/gus: Remove dead CONFIG_SND_DEBUG_ROM Christian Dietrich 2 siblings, 1 reply; 7+ messages in thread From: Christian Dietrich @ 2010-07-21 12:35 UTC (permalink / raw) To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel Cc: vamos-dev CONFIG_AT32_ENCHANCED_PORTMUX doesn't exist in Kconfig or somewhere else, therefore removing all references for it from the source code. Signed-off-by: Christian Dietrich <qy03fugy@stud.informatik.uni-erlangen.de> --- sound/soc/atmel/playpaq_wm8510.c | 9 --------- 1 files changed, 0 insertions(+), 9 deletions(-) diff --git a/sound/soc/atmel/playpaq_wm8510.c b/sound/soc/atmel/playpaq_wm8510.c index 9df4c68..fbd17e9 100644 --- a/sound/soc/atmel/playpaq_wm8510.c +++ b/sound/soc/atmel/playpaq_wm8510.c @@ -425,11 +425,6 @@ static int __init playpaq_asoc_init(void) clk_set_rate(CODEC_CLK, 12000000); clk_enable(CODEC_CLK); -#if defined CONFIG_AT32_ENHANCED_PORTMUX - at32_select_periph(MCLK_PIN, MCLK_PERIPH, 0); -#endif - - /* * Create and register platform device */ @@ -496,10 +491,6 @@ static void __exit playpaq_asoc_exit(void) _pll0 = NULL; } -#if defined CONFIG_AT32_ENHANCED_PORTMUX - at32_free_pin(MCLK_PIN); -#endif - platform_device_unregister(playpaq_snd_device); playpaq_snd_device = NULL; } -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] sound/soc/atmel: Remove dead CONFIG_AT32_ENHANCED_PORTMUX 2010-07-21 12:35 ` [PATCH 2/3] sound/soc/atmel: Remove dead CONFIG_AT32_ENHANCED_PORTMUX Christian Dietrich @ 2010-07-21 12:50 ` Mark Brown 0 siblings, 0 replies; 7+ messages in thread From: Mark Brown @ 2010-07-21 12:50 UTC (permalink / raw) To: Christian Dietrich Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel, Geoffrey Wossum, vamos-dev On Wed, Jul 21, 2010 at 02:35:41PM +0200, Christian Dietrich wrote: > CONFIG_AT32_ENCHANCED_PORTMUX doesn't exist in Kconfig or somewhere > else, therefore removing all references for it from the source code. > > Signed-off-by: Christian Dietrich <qy03fugy@stud.informatik.uni-erlangen.de> Please remember to CC maintainers on patches - I've added Geoffrey. > --- > sound/soc/atmel/playpaq_wm8510.c | 9 --------- > 1 files changed, 0 insertions(+), 9 deletions(-) > > diff --git a/sound/soc/atmel/playpaq_wm8510.c b/sound/soc/atmel/playpaq_wm8510.c > index 9df4c68..fbd17e9 100644 > --- a/sound/soc/atmel/playpaq_wm8510.c > +++ b/sound/soc/atmel/playpaq_wm8510.c > @@ -425,11 +425,6 @@ static int __init playpaq_asoc_init(void) > clk_set_rate(CODEC_CLK, 12000000); > clk_enable(CODEC_CLK); > > -#if defined CONFIG_AT32_ENHANCED_PORTMUX > - at32_select_periph(MCLK_PIN, MCLK_PERIPH, 0); > -#endif > - > - > /* > * Create and register platform device > */ > @@ -496,10 +491,6 @@ static void __exit playpaq_asoc_exit(void) > _pll0 = NULL; > } > > -#if defined CONFIG_AT32_ENHANCED_PORTMUX > - at32_free_pin(MCLK_PIN); > -#endif > - > platform_device_unregister(playpaq_snd_device); > playpaq_snd_device = NULL; > } > -- > 1.7.0.4 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] sound/isa/gus: Remove dead CONFIG_SND_DEBUG_ROM 2010-07-21 12:34 [PATCH 0/3] Removing dead code Christian Dietrich 2010-07-21 12:35 ` [PATCH 1/3] sound/oss: Remove dead CONFIG_SOFTOSS* Christian Dietrich 2010-07-21 12:35 ` [PATCH 2/3] sound/soc/atmel: Remove dead CONFIG_AT32_ENHANCED_PORTMUX Christian Dietrich @ 2010-07-21 12:36 ` Christian Dietrich 2010-07-21 12:57 ` Takashi Iwai 2 siblings, 1 reply; 7+ messages in thread From: Christian Dietrich @ 2010-07-21 12:36 UTC (permalink / raw) To: Jaroslav Kysela, Takashi Iwai, Tejun Heo, linux-kernel, alsa-devel Cc: vamos-dev CONFIG_SND_DEBUG_ROM doesn't exist in Kconfig, therefore it is never defined and we can remove all references to it. If it should stay as a debug flag, perhaps it shouldn't be named CONFIG_ Signed-off-by: Christian Dietrich <qy03fugy@stud.informatik.uni-erlangen.de> --- sound/isa/gus/interwave.c | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-) diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c index c7b80e4..ac60c7d 100644 --- a/sound/isa/gus/interwave.c +++ b/sound/isa/gus/interwave.c @@ -442,19 +442,11 @@ static void __devinit snd_interwave_detect_memory(struct snd_gus_card * gus) for (bank_pos = 0; bank_pos < 16L * 1024L * 1024L; bank_pos += 4L * 1024L * 1024L) { for (i = 0; i < 8; ++i) iwave[i] = snd_gf1_peek(gus, bank_pos + i); -#ifdef CONFIG_SND_DEBUG_ROM - printk(KERN_DEBUG "ROM at 0x%06x = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", bank_pos, - iwave[0], iwave[1], iwave[2], iwave[3], - iwave[4], iwave[5], iwave[6], iwave[7]); -#endif if (strncmp(iwave, "INTRWAVE", 8)) continue; /* first check */ csum = 0; for (i = 0; i < sizeof(struct rom_hdr); i++) csum += snd_gf1_peek(gus, bank_pos + i); -#ifdef CONFIG_SND_DEBUG_ROM - printk(KERN_DEBUG "ROM checksum = 0x%x (computed)\n", csum); -#endif if (csum != 0) continue; /* not valid rom */ gus->gf1.rom_banks++; -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] sound/isa/gus: Remove dead CONFIG_SND_DEBUG_ROM 2010-07-21 12:36 ` [PATCH 3/3] sound/isa/gus: Remove dead CONFIG_SND_DEBUG_ROM Christian Dietrich @ 2010-07-21 12:57 ` Takashi Iwai 0 siblings, 0 replies; 7+ messages in thread From: Takashi Iwai @ 2010-07-21 12:57 UTC (permalink / raw) To: Christian Dietrich Cc: Jaroslav Kysela, Tejun Heo, linux-kernel, alsa-devel, vamos-dev At Wed, 21 Jul 2010 14:36:02 +0200, Christian Dietrich wrote: > > CONFIG_SND_DEBUG_ROM doesn't exist in Kconfig, therefore it is never > defined and we can remove all references to it. If it should stay as a > debug flag, perhaps it shouldn't be named CONFIG_ > > Signed-off-by: Christian Dietrich <qy03fugy@stud.informatik.uni-erlangen.de> This is rather a debug code, so it's often useful to keep as is. At bets, we can rename the ifdef without CONFIG_ prefix. thanks, Takashi > --- > sound/isa/gus/interwave.c | 8 -------- > 1 files changed, 0 insertions(+), 8 deletions(-) > > diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c > index c7b80e4..ac60c7d 100644 > --- a/sound/isa/gus/interwave.c > +++ b/sound/isa/gus/interwave.c > @@ -442,19 +442,11 @@ static void __devinit snd_interwave_detect_memory(struct snd_gus_card * gus) > for (bank_pos = 0; bank_pos < 16L * 1024L * 1024L; bank_pos += 4L * 1024L * 1024L) { > for (i = 0; i < 8; ++i) > iwave[i] = snd_gf1_peek(gus, bank_pos + i); > -#ifdef CONFIG_SND_DEBUG_ROM > - printk(KERN_DEBUG "ROM at 0x%06x = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", bank_pos, > - iwave[0], iwave[1], iwave[2], iwave[3], > - iwave[4], iwave[5], iwave[6], iwave[7]); > -#endif > if (strncmp(iwave, "INTRWAVE", 8)) > continue; /* first check */ > csum = 0; > for (i = 0; i < sizeof(struct rom_hdr); i++) > csum += snd_gf1_peek(gus, bank_pos + i); > -#ifdef CONFIG_SND_DEBUG_ROM > - printk(KERN_DEBUG "ROM checksum = 0x%x (computed)\n", csum); > -#endif > if (csum != 0) > continue; /* not valid rom */ > gus->gf1.rom_banks++; > -- > 1.7.0.4 > ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-07-21 13:03 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-07-21 12:34 [PATCH 0/3] Removing dead code Christian Dietrich 2010-07-21 12:35 ` [PATCH 1/3] sound/oss: Remove dead CONFIG_SOFTOSS* Christian Dietrich 2010-07-21 13:03 ` Takashi Iwai 2010-07-21 12:35 ` [PATCH 2/3] sound/soc/atmel: Remove dead CONFIG_AT32_ENHANCED_PORTMUX Christian Dietrich 2010-07-21 12:50 ` Mark Brown 2010-07-21 12:36 ` [PATCH 3/3] sound/isa/gus: Remove dead CONFIG_SND_DEBUG_ROM Christian Dietrich 2010-07-21 12:57 ` Takashi Iwai
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox