linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/14] Removing dead code
@ 2010-09-06 14:35 Christian Dietrich
  2010-09-06 14:36 ` [PATCH 04/14] arch/{s390,powerpc}: Removing undead ifdef __KERNEL__ Christian Dietrich
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Dietrich @ 2010-09-06 14:35 UTC (permalink / raw)
  To: Lennert Buytenhek, Russell King, Yoshinori Sato, Kyle McMartin,
	Helge Deller, James E.J. Bottomley, Akinobu Mita,
	Benjamin Herrenschmidt, Paul Mackerras, Alexander Graf, K.Prasad,
	Dave Kleikamp, Martin Schwidefsky, Heiko Carstens, linux390,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Borislav Petkov, David S. Miller, Roland Dreier, Alexey Dobriyan,
	Joe Perches, Juergen E. Fischer, Tejun Heo, Krzysztof Helt,
	Andrew Morton, Geert Uytterhoeven, Petr Vandrovec, Jean Delvare,
	Arnaldo Carvalho de Melo, Eric W. Biederman, Ben Hutchings,
	Cyrill Gorcunov, Peter Zijlstra, Mike Galbraith, Dipankar Sarma,
	Paul E. McKenney, Josh Triplett, Lai Jiangshan, linux-arm-kernel,
	linux-kernel, linux-parisc, linuxppc-dev, linux-s390, netdev,
	linux-scsi, linux-fbdev
  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 whole sourcetree for
code block which are undead. This means they can't be deselected and
are always in the kernel if the enviroment of the block is
selected. They have often the form of

#ifdef ABC
....
#ifdef ABC
fooooo
#endif
#endif

Here the ifdefs of the inner block can be removed without any harm. At
this point we just checked the source code (for the undead), but we
want to do a crosscheck with the Kconfig for undead code blocks in the
future.

I build the patches against a vanilla kernel (v2.6.36-rc3) 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 (14):
  arch/arm: Removing undead ifdef __ASSEMBLY__
  arch/h8300: Removing dead ifdef __H8300_TLB_H__
  arch/parisc: Removing undead ifdef CONFIG_PA20
  arch/{s390,powerpc}: Removing undead ifdef __KERNEL__
  arch/x86: Removing undead ifdef ACPI/X86_IO_ACPI
  drivers/net: Removing undead ifdef CHELSIO_T1_1G
  drivers/scsi: Removing undead ifdef __ISAPNP__
  drivers/scsi: Removing undead ifdef CONFIG_PCI
  drivers/scsi: Removing undead ifdef REAL_DMA
  drivers/video: Removing undead ifdef ATAFB_FALCON
  drivers/video: Removing undead ifdef CONFIG_FB_MATROX_G
  include/linux: Removing undead ifdef __KERNEL__
  kernel/: Removing undead ifdef CONFIG_SMP
  kernel/: Removing undead ifdef CONFIG_DEBUG_LOCK_ALLOC

 arch/arm/mach-ixp23xx/include/mach/platform.h |    3 ---
 arch/h8300/include/asm/tlb.h                  |   13 -------------
 arch/parisc/kernel/unaligned.c                |    3 ---
 arch/powerpc/include/asm/processor.h          |    2 --
 arch/powerpc/include/asm/vdso_datapage.h      |    2 --
 arch/s390/include/asm/processor.h             |    4 ----
 arch/x86/kernel/early-quirks.c                |    2 --
 drivers/net/chelsio/subr.c                    |    2 --
 drivers/scsi/aha152x.c                        |    2 --
 drivers/scsi/aic7xxx_old.c                    |    2 --
 drivers/scsi/atari_NCR5380.c                  |    6 ------
 drivers/video/atafb.c                         |    2 --
 drivers/video/matrox/matroxfb_DAC1064.c       |    5 +----
 include/linux/socket.h                        |    6 +-----
 kernel/sched.c                                |    4 +---
 kernel/srcu.c                                 |    2 --
 16 files changed, 3 insertions(+), 57 deletions(-)

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

* [PATCH 04/14] arch/{s390,powerpc}: Removing undead ifdef __KERNEL__
  2010-09-06 14:35 [PATCH 00/14] Removing dead code Christian Dietrich
@ 2010-09-06 14:36 ` Christian Dietrich
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Dietrich @ 2010-09-06 14:36 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Alexander Graf, K.Prasad,
	Dave Kleikamp, Martin Schwidefsky, Heiko Carstens, linux390,
	linuxppc-dev, linux-kernel, linux-s390
  Cc: vamos-dev

The __KERNEL__ ifdef isn't necessary at this point, because it is
checked in an outer ifdef level already and has no effect here.

Signed-off-by: Christian Dietrich <qy03fugy@stud.informatik.uni-erlangen.de>
---
 arch/powerpc/include/asm/processor.h     |    2 --
 arch/powerpc/include/asm/vdso_datapage.h |    2 --
 arch/s390/include/asm/processor.h        |    4 ----
 3 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index 19c05b0..3defd7a 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -122,7 +122,6 @@ extern struct task_struct *last_task_used_spe;
 		TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64 )
 #endif
 
-#ifdef __KERNEL__
 #ifdef __powerpc64__
 
 #define STACK_TOP_USER64 TASK_SIZE_USER64
@@ -139,7 +138,6 @@ extern struct task_struct *last_task_used_spe;
 #define STACK_TOP_MAX	STACK_TOP
 
 #endif /* __powerpc64__ */
-#endif /* __KERNEL__ */
 
 typedef struct {
 	unsigned long seg;
diff --git a/arch/powerpc/include/asm/vdso_datapage.h b/arch/powerpc/include/asm/vdso_datapage.h
index 08679c5..25e3922 100644
--- a/arch/powerpc/include/asm/vdso_datapage.h
+++ b/arch/powerpc/include/asm/vdso_datapage.h
@@ -116,9 +116,7 @@ struct vdso_data {
 
 #endif /* CONFIG_PPC64 */
 
-#ifdef __KERNEL__
 extern struct vdso_data *vdso_data;
-#endif
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h
index 73e2598..0e2a436 100644
--- a/arch/s390/include/asm/processor.h
+++ b/arch/s390/include/asm/processor.h
@@ -52,8 +52,6 @@ extern int get_cpu_capability(unsigned int *);
 
 #endif /* __s390x__ */
 
-#ifdef __KERNEL__
-
 #ifndef __s390x__
 #define STACK_TOP		(1UL << 31)
 #define STACK_TOP_MAX		(1UL << 31)
@@ -63,8 +61,6 @@ extern int get_cpu_capability(unsigned int *);
 #endif /* __s390x__ */
 
 
-#endif
-
 #define HAVE_ARCH_PICK_MMAP_LAYOUT
 
 typedef struct {
-- 
1.7.0.4

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

end of thread, other threads:[~2010-09-06 14:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-06 14:35 [PATCH 00/14] Removing dead code Christian Dietrich
2010-09-06 14:36 ` [PATCH 04/14] arch/{s390,powerpc}: Removing undead ifdef __KERNEL__ Christian Dietrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).