Removing dead code
Subsystems (14)
cover Removing dead code
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(-)
PATCH 1/14 arch/arm: Removing undead ifdef __ASSEMBLY__
The __ASSEMBLY__ ifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
--- arch/arm/mach-ixp23xx/include/mach/platform.h | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
arch/arm/mach-ixp23xx/include/mach/platform.h +0 -3
@@ -43,7 +43,6 @@ extern struct sys_timer ixp23xx_timer;#define IXP23XX_UART_XTAL 14745600 -#ifndef __ASSEMBLY__/* * Is system memory on the XSI or CPP bus? */
@@ -51,7 +50,5 @@ static inline unsigned ixp23xx_cpp_boot(void) {return (*IXP23XX_EXP_CFG0 &IXP23XX_EXP_CFG0_XSI_NOT_PRES ); } -#endif -#endif
Signature · 1 line
1.7.0.4
PATCH 2/14 arch/h8300: Removing dead ifdef __H8300_TLB_H__
In reply to Christian DietrichThe nested __H8300_TLB_H__ include guard isn't necessary at this point, because the symbol is always defined at this point and the block content will always be removed.
--- arch/h8300/include/asm/tlb.h | 13 ------------- 1 files changed, 0 insertions(+), 13 deletions(-)
arch/h8300/include/asm/tlb.h +0 -13
@@ -7,17 +7,4 @@#define tlb_flush (tlb) do { } while(0) -/* -include/asm-h8300/tlb.h -*/ - -#ifndef __H8300_TLB_H__ -#define __H8300_TLB_H__ - -#define tlb_flush (tlb) do { } while(0) - -#include <asm-generic/tlb.h> - -#endif -#endif
Signature · 1 line
1.7.0.4
Re: [PATCH 02/14] arch/h8300: Removing dead ifdef __H8300_TLB_H__
Quoted 21 lines · Christian Dietrich
The nested
__H8300_TLB_H__include guard isn't necessary at this point, because the symbol is always defined at this point and the block content will always be removed.Signed-off-by Christian Dietrich <[email protected]>--- arch/h8300/include/asm/tlb.h | 13 ------------- 1 files changed, 0 insertions(+), 13 deletions(-)arch/h8300/include/asm/tlb.h +0
-4@@ -7,17 +7,4 @@#define tlb_flush (tlb) do { } while(0) -/* -include/asm-h8300/tlb.h -*/ -
arch/h8300/include/asm/tlb.h line 10
Quoted 10 lines
arch/h8300/include/asm/tlb.h +0
-9-#ifndef __H8300_TLB_H__ -#define __H8300_TLB_H__ - -#define tlb_flush (tlb) do { } while(0) - -#include <asm-generic/tlb.h> - -#endif -#endif
Looks like someone patched the file twice with the same patch, see
<http://git.kernel.org/?p=linux/kernel/git/tglx/history.git;a=commitdiff;h=398f579808cb74dd4c418df72ff8ff5971038e4f#patch24>
Andreas.
Signature · 3 lines
Andreas Schwab, [email protected] GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
PATCH 3/14 arch/parisc: Removing undead ifdef CONFIG_PA20
In reply to Christian DietrichThe CONFIG_PA20 ifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
--- arch/parisc/kernel/unaligned.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
arch/parisc/kernel/unaligned.c +0 -3
@@ -619,15 +619,12 @@ void handle_unaligned(struct pt_regs *regs) flop=1 ; ret =emulate_std (regs,R2 (regs->iir),1 );break ; - -#ifdef CONFIG_PA20 case OPCODE_LDD_L : ret =emulate_ldd (regs,R2 (regs->iir),0 );break ;case OPCODE_STD_L : ret =emulate_std (regs,R2 (regs->iir),0 );break ; -#endif }#endif switch (regs->iir & OPCODE3_MASK)
Signature · 1 line
1.7.0.4
Re: [PATCH 03/14] arch/parisc: Removing undead ifdef CONFIG_PA20
Quoted 3 lines · Christian Dietrich
The
CONFIG_PA20ifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
Looks good, applied, thanks.
-- Kyle
Quoted 29 lines
Signed-off-by Christian Dietrich <[email protected]>--- arch/parisc/kernel/unaligned.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)arch/parisc/kernel/unaligned.c +0
-3@@ -619,15 +619,12 @@ void handle_unaligned(struct pt_regs *regs) flop=1 ; ret =emulate_std (regs,R2 (regs->iir),1 );break ; - -#ifdef CONFIG_PA20 case OPCODE_LDD_L : ret =emulate_ldd (regs,R2 (regs->iir),0 );break ;case OPCODE_STD_L : ret =emulate_std (regs,R2 (regs->iir),0 );break ; -#endif }#endif switch (regs->iir & OPCODE3_MASK)Signature · 1 line
1.7.0.4
PATCH 4/14 arch/{s390,powerpc}: Removing undead ifdef __KERNEL__
In reply to Christian DietrichThe __KERNEL__ ifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
--- 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(-)
arch/powerpc/include/asm/processor.h +0 -2
@@ -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;
arch/powerpc/include/asm/vdso_datapage.h +0 -2
@@ -116,9 +116,7 @@ struct vdso_data {#endif /* CONFIG_PPC64 */ -#ifdef __KERNEL__extern struct vdso_data *vdso_data; -#endif #endif /* __ASSEMBLY__ */
arch/s390/include/asm/processor.h +0 -4
@@ -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 {
Signature · 1 line
1.7.0.4
PATCH 5/14 arch/x86: Removing undead ifdef ACPI/X86_IO_ACPI
In reply to Christian DietrichThe ACPI/X86_IO_ACPI ifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
--- arch/x86/kernel/early-quirks.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
arch/x86/kernel/early-quirks.c +0 -2
@@ -98,7 +98,6 @@ static void __init nvidia_bugs(int num, int slot, int func) }#if defined(CONFIG_ACPI ) && defined(CONFIG_X86_IO_APIC ) -#if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC)static u32 __init ati_ixp4x0_rev (int num,int slot,int func) {u32 d;
@@ -116,7 +115,6 @@ static u32 __init ati_ixp4x0_rev(int num, int slot, int func) d &=0xff ;return d; } -#endif static void __init ati_bugs (int num,int slot,int func) {
Signature · 1 line
1.7.0.4
Re: [PATCH 05/14] arch/x86: Removing undead ifdef ACPI/X86_IO_ACPI
From: Christian Dietrich <[email protected]>
Date: Mon, Sep 06, 2010 at 10:36:18AM -0400
Quoted 4 lines
The ACPI/X86_IO_ACPI 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 <[email protected]>
Signature · 8 lines
Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach General Managers: Alberto Bozzo, Andrew Bowd Registration: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632
[tip:x86/cleanups] x86: Remove unnecessary #ifdef ACPI/X86_IO_ACPI
In reply to Christian DietrichCommit-ID: 0f1cf415f00286a38f5ce35b459342dbfc895b50 Gitweb: http://git.kernel.org/tip/0f1cf415f00286a38f5ce35b459342dbfc895b50 Author: Christian Dietrich <[email protected]> AuthorDate: Mon, 6 Sep 2010 16:36:18 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 8 Sep 2010 08:14:02 +0200
x86: Remove unnecessary #ifdef ACPI/X86_IO_ACPI
The ACPI/X86_IO_ACPI ifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
Cleanup only, no functional effect.
LKML-Reference: <d4376e6d79b8dc0f89a4b3ce4a880904a7b93ead.1283782701.git.qy03fugy@stud.informatik.uni-erlangen.de>
--- arch/x86/kernel/early-quirks.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
arch/x86/kernel/early-quirks.c +0 -2
@@ -98,7 +98,6 @@ static void __init nvidia_bugs(int num, int slot, int func) }#if defined(CONFIG_ACPI ) && defined(CONFIG_X86_IO_APIC ) -#if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC)static u32 __init ati_ixp4x0_rev (int num,int slot,int func) {u32 d;
@@ -116,7 +115,6 @@ static u32 __init ati_ixp4x0_rev(int num, int slot, int func) d &=0xff ;return d; } -#endif static void __init ati_bugs (int num,int slot,int func) {
PATCH 6/14 drivers/net: Removing undead ifdef CHELSIO_T1_1G
In reply to Christian DietrichThe CHELSIO_T1_1G ifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
--- drivers/net/chelsio/subr.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/net/chelsio/subr.c +0 -2
@@ -314,14 +314,12 @@ static int mi1_mdio_write(struct net_device *dev, int phy_addr, int mmd_addr, return 0; } -#if defined(CONFIG_CHELSIO_T1_1G )static const struct mdio_ops mi1_mdio_ops = { .init = mi1_mdio_init, .read = mi1_mdio_read, .write = mi1_mdio_write, .mode_support =MDIO_SUPPORTS_C22 }; -#endif #endif
Signature · 1 line
1.7.0.4
Re: [PATCH 06/14] drivers/net: Removing undead ifdef CHELSIO_T1_1G
From: Christian Dietrich <[email protected]>
Date: Mon, 6 Sep 2010 16:36:25 +0200
Quoted 4 lines
The
CHELSIO_T1_1Gifdef 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 <[email protected]>
Applied.
PATCH 7/14 drivers/scsi: Removing undead ifdef __ISAPNP__
In reply to Christian DietrichThe __ISAPNP__ ifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
--- drivers/scsi/aha152x.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/scsi/aha152x.c +0 -2
@@ -3806,9 +3806,7 @@ static int __init aha152x_init(void)#if defined(AHA152X_DEBUG ) setup[setup_count].debug =DEBUG_DEFAULT ;#endif -#if defined(__ISAPNP__) pnpdev[setup_count] = dev; -#endif printk (KERN_INFO "aha152x: found ISAPnP adapter at io=0x%03x, irq=%d\n" , setup[setup_count].io_port, setup[setup_count].irq);
Signature · 1 line
1.7.0.4
PATCH 8/14 drivers/scsi: Removing undead ifdef CONFIG_PCI
In reply to Christian DietrichThe CONFIG_PCI ifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
--- drivers/scsi/aic7xxx_old.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/scsi/aic7xxx_old.c +0 -2
@@ -9655,9 +9655,7 @@ aic7xxx_detect(struct scsi_host_template *template) found++;continue ; skip_pci_controller: -#ifdef CONFIG_PCI pci_release_regions (temp_p->pdev); -#endif kfree (temp_p); }/* Found an Adaptec PCI device. */ else /* Well, we found one, but we couldn't get any memory */
Signature · 1 line
1.7.0.4
PATCH 9/14 drivers/scsi: Removing undead ifdef REAL_DMA
In reply to Christian DietrichThe REAL_DMA ifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
--- drivers/scsi/atari_NCR5380.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
drivers/scsi/atari_NCR5380.c +0 -6
@@ -1942,9 +1942,7 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance,NCR5380_write (TARGET_COMMAND_REG ,PHASE_SR_TO_TCR (p)); -#ifdef REAL_DMA NCR5380_write (MODE_REG ,MR_BASE |MR_DMA_MODE |MR_ENABLE_EOP_INTR |MR_MONITOR_BSY ); -#endif /* def REAL_DMA */ if (IS_A_TT ()) {/* On the Medusa, it is a must to initialize the DMA before
@@ -2101,16 +2099,12 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) cmd->scsi_done (cmd); /* XXX - need to source or sink data here, as appropriate */ }else { -#ifdef REAL_DMA /* ++roman: When using real DMA, * information_transfer() should return after * starting DMA since it has nothing more to * do. */ return ; -#else - cmd->SCp.this_residual -= transfersize - len; -#endif } } else#endif /* defined(REAL_DMA) */
Signature · 1 line
1.7.0.4
PATCH 10/14 drivers/video: Removing undead ifdef ATAFB_FALCON
In reply to Christian DietrichThe ATAFB_FALCON ifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
--- drivers/video/atafb.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/video/atafb.c +0 -2
@@ -1718,11 +1718,9 @@ static int falcon_setcolreg(unsigned int regno, unsigned int red, (((red &0xe000 ) >>13 ) | ((red &0x1000 ) >>12 ) <<8 ) | (((green &0xe000 ) >>13 ) | ((green &0x1000 ) >>12 ) <<4 ) | ((blue &0xe000 ) >>13 ) | ((blue &0x1000 ) >>12 ); -#ifdef ATAFB_FALCON ((u32 *)info->pseudo_palette)[regno] = ((red &0xf800 ) | ((green &0xfc00 ) >>5 ) | ((blue &0xf800 ) >>11 )); -#endif }return 0 ; }
Signature · 1 line
1.7.0.4
Re: [PATCH 10/14] drivers/video: Removing undead ifdef ATAFB_FALCON
Quoted 5 lines · On Mon, 6 Sep 2010 16:36:47 +0200 Christian Dietrich…
The
ATAFB_FALCONifdef 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 <[email protected]>---
Right.
Geert Uytterhoeven
AppliedRe: [PATCH 10/14] drivers/video: Removing undead ifdef ATAFB_FALCON
Quoted 9 lines · Krzysztof Helt
Quoted 4 lines · On Mon, 6 Sep 2010 16:36:47 +0200 Christian Dietrich…
The
ATAFB_FALCONifdef 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 <[email protected]>Acked-by Krzysztof Helt <[email protected]>
Applied to m68k tree, queued for 2.6.37.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
PATCH 11/14 drivers/video: Removing undead ifdef CONFIG_FB_MATROX_G
In reply to Christian DietrichThe CONFIG_FB_MATROX_G ifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
--- drivers/video/matrox/matroxfb_DAC1064.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/video/matrox/matroxfb_DAC1064.c +1 -4
@@ -869,12 +869,9 @@ static int MGAG100_preinit(struct matrox_fb_info *minfo) minfo->capable.plnwt = minfo->devflags.accelerator =FB_ACCEL_MATROX_MGAG100 ? minfo->devflags.sgram :1 ; -#ifdef CONFIG_FB_MATROX_G if (minfo->devflags.g450dac) { minfo->outputs[0 ].output = &g450out; - } else -#endif - { + }else { minfo->outputs[0 ].output = &m1064; } minfo->outputs[0 ].src = minfo->outputs[0 ].default_src;
Signature · 1 line
1.7.0.4
Re: [PATCH 11/14] drivers/video: Removing undead ifdef CONFIG_FB_MATROX_G
Quoted 16 lines · Christian Dietrich
The
CONFIG_FB_MATROX_Gifdef 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 <[email protected]>--- drivers/video/matrox/matroxfb_DAC1064.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)drivers/video/matrox/matroxfb_DAC1064.c +0
-0@@ -869,12 +869,9 @@ static int MGAG100_preinit(struct matrox_fb_info *minfo) minfo->capable.plnwt = minfo->devflags.accelerator =FB_ACCEL_MATROX_MGAG100 ? minfo->devflags.sgram :1 ;
drivers/video/matrox/matroxfb_DAC1064.c static int MGAG100_preinit(struct matrox_fb_info *minfo) · line 877
Quoted 10 lines
drivers/video/matrox/matroxfb_DAC1064.c +1
-4-#ifdef CONFIG_FB_MATROX_G if (minfo->devflags.g450dac) { minfo->outputs[0 ].output = &g450out; - } else -#endif - { + }else { minfo->outputs[0 ].output = &m1064; } minfo->outputs[0 ].src = minfo->outputs[0 ].default_src;
Indeed.
Signature · 1 line
Jean Delvare
PATCH 12/14 include/linux: Removing undead ifdef __KERNEL__
In reply to Christian DietrichThe __KERNEL__ ifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
--- include/linux/socket.h | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)
include/linux/socket.h +1 -5
@@ -30,12 +30,10 @@ struct cred;#define __sockaddr_check_size (size) \ BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage))) -#ifdef __KERNEL__# ifdef CONFIG_PROC_FS struct seq_file ;extern void socket_seq_show (struct seq_file *seq);# endif -#endif /* __KERNEL__ */ typedef unsigned short sa_family_t ;
@@ -311,7 +309,6 @@ struct ucred {/* IPX options */ #define IPX_TYPE 1 -#ifdef __KERNEL__extern void cred_to_ucred (struct pid *pid,const struct cred *cred,struct ucred *ucred);extern int memcpy_fromiovec (unsigned char *kdata,struct iovec *iov,int len);
@@ -334,6 +331,5 @@ struct timespec;extern int __sys_recvmmsg (int fd,struct mmsghdr __user *mmsg,unsigned int vlen,unsigned int flags,struct timespec *timeout); -#endif -#endif /* not kernel and not glibc */ +#endif /* __KERNEL__ */ #endif /* _LINUX_SOCKET_H */
Signature · 1 line
1.7.0.4
Re: [PATCH 12/14] include/linux: Removing undead ifdef __KERNEL__
Quoted 5 lines · Christian Dietrich
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 <[email protected]>---
The origin looks weird indeed. So I presume it's here for historical reasons. Well, from git log it shows a lot of glibc tricks were here. And the former top __KERNEL__ is by commit 9c501935a3cdcf6b1d35aaee3aa11c7a7051a305 so
Thanks Christian
-- Cyrill
PATCH 13/14 kernel/: Removing undead ifdef CONFIG_SMP
In reply to Christian DietrichThe CONFIG_SMP ifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
--- kernel/sched.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
kernel/sched.c +1 -3
@@ -426,9 +426,7 @@ struct root_domain {*/ cpumask_var_t rto_mask;atomic_t rto_count; -#ifdef CONFIG_SMP struct cpupri cpupri; -#endif };/*
@@ -437,7 +435,7 @@ struct root_domain {*/ static struct root_domain def_root_domain; -#endif +#endif /* CONFIG_SMP */ /* * This is the main, per-CPU runqueue data structure.
Signature · 1 line
1.7.0.4
[tip:sched/core] sched: Remove unnecessary #ifdef CONFIG_SMP
Commit-ID: ed2d372c0738386b8a184a6a6bea9c16df6ffb68 Gitweb: http://git.kernel.org/tip/ed2d372c0738386b8a184a6a6bea9c16df6ffb68 Author: Christian Dietrich <[email protected]> AuthorDate: Mon, 6 Sep 2010 16:37:05 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 8 Sep 2010 08:14:20 +0200
sched: Remove unnecessary #ifdef CONFIG_SMP
The CONFIG_SMP ifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
Cleanup only, no functional effect.
LKML-Reference: <7a3a39ef3f765a4473cb026b1f204059568a7098.1283782701.git.qy03fugy@stud.informatik.uni-erlangen.de>
--- kernel/sched.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
kernel/sched.c +1 -3
@@ -426,9 +426,7 @@ struct root_domain {*/ cpumask_var_t rto_mask;atomic_t rto_count; -#ifdef CONFIG_SMP struct cpupri cpupri; -#endif };/*
@@ -437,7 +435,7 @@ struct root_domain {*/ static struct root_domain def_root_domain; -#endif +#endif /* CONFIG_SMP */ /* * This is the main, per-CPU runqueue data structure.
PATCH 14/14 kernel/: Removing undead ifdef CONFIG_DEBUG_LOCK_ALLOC
In reply to Christian DietrichThe CONFIG_DEBUG_LOCK_ALLOC ifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
--- kernel/srcu.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
kernel/srcu.c +0 -2
@@ -46,11 +46,9 @@ static int init_srcu_struct_fields(struct srcu_struct *sp)int __init_srcu_struct (struct srcu_struct *sp,const char *name,struct lock_class_key *key) { -#ifdef CONFIG_DEBUG_LOCK_ALLOC /* Don't re-initialize a lock while it is held. */ debug_check_no_locks_freed ((void *)sp,sizeof (*sp));lockdep_init_map (&sp->dep_map, name, key,0 ); -#endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ return init_srcu_struct_fields (sp); }EXPORT_SYMBOL_GPL (__init_srcu_struct);
Signature · 1 line
1.7.0.4
Re: [PATCH 14/14] kernel/: Removing undead ifdef CONFIG_DEBUG_LOCK_ALLOC
Quoted 2 lines · Christian Dietrich
The
CONFIG_DEBUG_LOCK_ALLOCifdef isn't necessary at this point, because it is checked in an outer ifdef level already and has no effect here.
Good catch, queued!
Thanx, Paul
Quoted 24 lines
Signed-off-by Christian Dietrich <[email protected]>--- kernel/srcu.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)kernel/srcu.c +0
-2@@ -46,11 +46,9 @@ static int init_srcu_struct_fields(struct srcu_struct *sp)int __init_srcu_struct (struct srcu_struct *sp,const char *name,struct lock_class_key *key) { -#ifdef CONFIG_DEBUG_LOCK_ALLOC /* Don't re-initialize a lock while it is held. */ debug_check_no_locks_freed ((void *)sp,sizeof (*sp));lockdep_init_map (&sp->dep_map, name, key,0 ); -#endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ return init_srcu_struct_fields (sp); }EXPORT_SYMBOL_GPL (__init_srcu_struct);Signature · 1 line
1.7.0.4