* [PATCH 0/2] Removing dead code
@ 2010-06-28 13:40 Christoph Egger
2010-06-28 13:41 ` [PATCH 1/2] Removing dead CONFIG_PARAVIRT_GUEST_ASM_CLOBBER_CHECK Christoph Egger
2010-06-28 13:41 ` [PATCH 2/2] Removing dead CONFIG_IOMMU_DEBUG Christoph Egger
0 siblings, 2 replies; 5+ messages in thread
From: Christoph Egger @ 2010-06-28 13:40 UTC (permalink / raw)
To: Tony Luck, Fenghua Yu, linux-ia64, linux-kernel
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 arch/ia64 sourcetree for
config Items not defined in Kconfig and found 2 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.
Please keep me informed of this patch getting confirmed /
merged so we can keep track of it.
Regards
Christoph Egger
[0] http://vamos1.informatik.uni-erlangen.de/
Christoph Egger (2):
Removing dead CONFIG_PARAVIRT_GUEST_ASM_CLOBBER_CHECK
Removing dead CONFIG_IOMMU_DEBUG
arch/ia64/include/asm/native/inst.h | 96 ++++++++--------------------------
arch/ia64/kernel/pci-dma.c | 4 --
2 files changed, 23 insertions(+), 77 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1/2] Removing dead CONFIG_PARAVIRT_GUEST_ASM_CLOBBER_CHECK
2010-06-28 13:40 [PATCH 0/2] Removing dead code Christoph Egger
@ 2010-06-28 13:41 ` Christoph Egger
2010-06-28 13:41 ` [PATCH 2/2] Removing dead CONFIG_IOMMU_DEBUG Christoph Egger
1 sibling, 0 replies; 5+ messages in thread
From: Christoph Egger @ 2010-06-28 13:41 UTC (permalink / raw)
To: Tony Luck, Fenghua Yu, linux-ia64, linux-kernel; +Cc: vamos
CONFIG_PARAVIRT_GUEST_ASM_CLOBBER_CHECK doesn't exist in Kconfig,
therefore removing all references for it from the source code.
Signed-off-by: Christoph Egger <siccegge@cs.fau.de>
---
arch/ia64/include/asm/native/inst.h | 96 ++++++++--------------------------
1 files changed, 23 insertions(+), 73 deletions(-)
diff --git a/arch/ia64/include/asm/native/inst.h b/arch/ia64/include/asm/native/inst.h
index d2d46ef..4800a1e 100644
--- a/arch/ia64/include/asm/native/inst.h
+++ b/arch/ia64/include/asm/native/inst.h
@@ -33,21 +33,6 @@
#define paravirt_fsyscall_table ia64_native_fsyscall_table
#define paravirt_fsys_bubble_down ia64_native_fsys_bubble_down
-#ifdef CONFIG_PARAVIRT_GUEST_ASM_CLOBBER_CHECK
-# define PARAVIRT_POISON 0xdeadbeefbaadf00d
-# define CLOBBER(clob) \
- ;; \
- movl clob = PARAVIRT_POISON; \
- ;;
-# define CLOBBER_PRED(pred_clob) \
- ;; \
- cmp.eq pred_clob, p0 = r0, r0 \
- ;;
-#else
-# define CLOBBER(clob) /* nothing */
-# define CLOBBER_PRED(pred_clob) /* nothing */
-#endif
-
#define MOV_FROM_IFA(reg) \
mov reg = cr.ifa
@@ -70,106 +55,76 @@
mov reg = cr.iip
#define MOV_FROM_IVR(reg, clob) \
- mov reg = cr.ivr \
- CLOBBER(clob)
+ mov reg = cr.ivr
#define MOV_FROM_PSR(pred, reg, clob) \
-(pred) mov reg = psr \
- CLOBBER(clob)
+(pred) mov reg = psr
#define MOV_FROM_ITC(pred, pred_clob, reg, clob) \
-(pred) mov reg = ar.itc \
- CLOBBER(clob) \
- CLOBBER_PRED(pred_clob)
+(pred) mov reg = ar.itc
#define MOV_TO_IFA(reg, clob) \
- mov cr.ifa = reg \
- CLOBBER(clob)
+ mov cr.ifa = reg
#define MOV_TO_ITIR(pred, reg, clob) \
-(pred) mov cr.itir = reg \
- CLOBBER(clob)
+(pred) mov cr.itir = reg
#define MOV_TO_IHA(pred, reg, clob) \
-(pred) mov cr.iha = reg \
- CLOBBER(clob)
+(pred) mov cr.iha = reg
#define MOV_TO_IPSR(pred, reg, clob) \
-(pred) mov cr.ipsr = reg \
- CLOBBER(clob)
+(pred) mov cr.ipsr = reg
#define MOV_TO_IFS(pred, reg, clob) \
-(pred) mov cr.ifs = reg \
- CLOBBER(clob)
+(pred) mov cr.ifs = reg
#define MOV_TO_IIP(reg, clob) \
- mov cr.iip = reg \
- CLOBBER(clob)
+ mov cr.iip = reg
#define MOV_TO_KR(kr, reg, clob0, clob1) \
- mov IA64_KR(kr) = reg \
- CLOBBER(clob0) \
- CLOBBER(clob1)
+ mov IA64_KR(kr) = reg
#define ITC_I(pred, reg, clob) \
-(pred) itc.i reg \
- CLOBBER(clob)
+(pred) itc.i reg
#define ITC_D(pred, reg, clob) \
-(pred) itc.d reg \
- CLOBBER(clob)
+(pred) itc.d reg
#define ITC_I_AND_D(pred_i, pred_d, reg, clob) \
(pred_i) itc.i reg; \
-(pred_d) itc.d reg \
- CLOBBER(clob)
+(pred_d) itc.d reg
#define THASH(pred, reg0, reg1, clob) \
-(pred) thash reg0 = reg1 \
- CLOBBER(clob)
+(pred) thash reg0 = reg1
#define SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(clob0, clob1) \
- ssm psr.ic | PSR_DEFAULT_BITS \
- CLOBBER(clob0) \
- CLOBBER(clob1) \
+ ssm psr.ic | PSR_DEFAULT_BITS \
;; \
srlz.i /* guarantee that interruption collectin is on */ \
;;
#define SSM_PSR_IC_AND_SRLZ_D(clob0, clob1) \
- ssm psr.ic \
- CLOBBER(clob0) \
- CLOBBER(clob1) \
+ ssm psr.ic \
;; \
srlz.d
#define RSM_PSR_IC(clob) \
- rsm psr.ic \
- CLOBBER(clob)
+ rsm psr.ic
#define SSM_PSR_I(pred, pred_clob, clob) \
-(pred) ssm psr.i \
- CLOBBER(clob) \
- CLOBBER_PRED(pred_clob)
+(pred) ssm psr.i
#define RSM_PSR_I(pred, clob0, clob1) \
-(pred) rsm psr.i \
- CLOBBER(clob0) \
- CLOBBER(clob1)
+(pred) rsm psr.i
#define RSM_PSR_I_IC(clob0, clob1, clob2) \
- rsm psr.i | psr.ic \
- CLOBBER(clob0) \
- CLOBBER(clob1) \
- CLOBBER(clob2)
+ rsm psr.i | psr.ic
#define RSM_PSR_DT \
rsm psr.dt
#define RSM_PSR_BE_I(clob0, clob1) \
- rsm psr.be | psr.i \
- CLOBBER(clob0) \
- CLOBBER(clob1)
+ rsm psr.be | psr.i
#define SSM_PSR_DT_AND_SRLZ_I \
ssm psr.dt \
@@ -177,15 +132,10 @@
srlz.i
#define BSW_0(clob0, clob1, clob2) \
- bsw.0 \
- CLOBBER(clob0) \
- CLOBBER(clob1) \
- CLOBBER(clob2)
+ bsw.0
#define BSW_1(clob0, clob1) \
- bsw.1 \
- CLOBBER(clob0) \
- CLOBBER(clob1)
+ bsw.1
#define COVER \
cover
--
1.7.0.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] Removing dead CONFIG_IOMMU_DEBUG
2010-06-28 13:40 [PATCH 0/2] Removing dead code Christoph Egger
2010-06-28 13:41 ` [PATCH 1/2] Removing dead CONFIG_PARAVIRT_GUEST_ASM_CLOBBER_CHECK Christoph Egger
@ 2010-06-28 13:41 ` Christoph Egger
1 sibling, 0 replies; 5+ messages in thread
From: Christoph Egger @ 2010-06-28 13:41 UTC (permalink / raw)
To: Tony Luck, Fenghua Yu, linux-ia64, linux-kernel; +Cc: vamos
CONFIG_IOMMU_DEBUG doesn't exist in Kconfig, therefore removing all
references for it from the source code.
Signed-off-by: Christoph Egger <siccegge@cs.fau.de>
---
arch/ia64/kernel/pci-dma.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c
index f6b1ff0..b70d53a 100644
--- a/arch/ia64/kernel/pci-dma.c
+++ b/arch/ia64/kernel/pci-dma.c
@@ -26,11 +26,7 @@ EXPORT_SYMBOL(bad_dma_address);
static int iommu_sac_force __read_mostly;
int no_iommu __read_mostly;
-#ifdef CONFIG_IOMMU_DEBUG
-int force_iommu __read_mostly = 1;
-#else
int force_iommu __read_mostly;
-#endif
int iommu_pass_through;
--
1.7.0.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 5/5] Remove REDWOOD_5 and REDWOOD_6 config options and conditional code
@ 2010-07-14 14:05 Christian Dietrich
2010-07-15 7:42 ` [5/5] " Milton Miller
0 siblings, 1 reply; 5+ messages in thread
From: Christian Dietrich @ 2010-07-14 14:05 UTC (permalink / raw)
To: Josh Boyer, Matt Porter, Benjamin Herrenschmidt, Paul Mackerras,
Solomon Peachy, David Woodhouse, Mike Frysinger, Jiri Kosina,
Artem Bityutskiy, Alexander Kurz, David S. Miller, Randy Dunlap,
John Linn, Florian Fainelli, linuxppc-dev, linux-kernel,
linux-mtd, netdev
Cc: vamos-dev
The config options for REDWOOD_[56] were commented out in the powerpc
Kconfig. The ifdefs referencing this options therefore are dead and all
references to this can be removed (Also dependencies in other KConfig
files).
Signed-off-by: Christian Dietrich <qy03fugy@stud.informatik.uni-erlangen.de>
---
arch/powerpc/platforms/40x/Kconfig | 16 -------------
drivers/mtd/maps/Kconfig | 2 +-
drivers/mtd/maps/redwood.c | 43 ------------------------------------
drivers/net/Kconfig | 2 +-
4 files changed, 2 insertions(+), 61 deletions(-)
diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig
index ec64264..b721764 100644
--- a/arch/powerpc/platforms/40x/Kconfig
+++ b/arch/powerpc/platforms/40x/Kconfig
@@ -71,22 +71,6 @@ config MAKALU
help
This option enables support for the AMCC PPC405EX board.
-#config REDWOOD_5
-# bool "Redwood-5"
-# depends on 40x
-# default n
-# select STB03xxx
-# help
-# This option enables support for the IBM STB04 evaluation board.
-
-#config REDWOOD_6
-# bool "Redwood-6"
-# depends on 40x
-# default n
-# select STB03xxx
-# help
-# This option enables support for the IBM STBx25xx evaluation board.
-
#config SYCAMORE
# bool "Sycamore"
# depends on 40x
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
index f22bc9f..b5ebb72 100644
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -321,7 +321,7 @@ config MTD_CFI_FLAGADM
config MTD_REDWOOD
tristate "CFI Flash devices mapped on IBM Redwood"
- depends on MTD_CFI && ( REDWOOD_4 || REDWOOD_5 || REDWOOD_6 )
+ depends on MTD_CFI && REDWOOD_4
help
This enables access routines for the flash chips on the IBM
Redwood board. If you have one of these boards and would like to
diff --git a/drivers/mtd/maps/redwood.c b/drivers/mtd/maps/redwood.c
index 933c0b6..d2c9db0 100644
--- a/drivers/mtd/maps/redwood.c
+++ b/drivers/mtd/maps/redwood.c
@@ -22,8 +22,6 @@
#include <asm/io.h>
-#if !defined (CONFIG_REDWOOD_6)
-
#define WINDOW_ADDR 0xffc00000
#define WINDOW_SIZE 0x00400000
@@ -69,47 +67,6 @@ static struct mtd_partition redwood_flash_partitions[] = {
}
};
-#else /* CONFIG_REDWOOD_6 */
-/* FIXME: the window is bigger - armin */
-#define WINDOW_ADDR 0xff800000
-#define WINDOW_SIZE 0x00800000
-
-#define RW_PART0_OF 0
-#define RW_PART0_SZ 0x400000 /* 4 MiB data */
-#define RW_PART1_OF RW_PART0_OF + RW_PART0_SZ
-#define RW_PART1_SZ 0x10000 /* 64K VPD */
-#define RW_PART2_OF RW_PART1_OF + RW_PART1_SZ
-#define RW_PART2_SZ 0x400000 - (0x10000 + 0x20000)
-#define RW_PART3_OF RW_PART2_OF + RW_PART2_SZ
-#define RW_PART3_SZ 0x20000
-
-static struct mtd_partition redwood_flash_partitions[] = {
- {
- .name = "Redwood filesystem",
- .offset = RW_PART0_OF,
- .size = RW_PART0_SZ
- },
- {
- .name = "Redwood OpenBIOS Vital Product Data",
- .offset = RW_PART1_OF,
- .size = RW_PART1_SZ,
- .mask_flags = MTD_WRITEABLE /* force read-only */
- },
- {
- .name = "Redwood kernel",
- .offset = RW_PART2_OF,
- .size = RW_PART2_SZ
- },
- {
- .name = "Redwood OpenBIOS",
- .offset = RW_PART3_OF,
- .size = RW_PART3_SZ,
- .mask_flags = MTD_WRITEABLE /* force read-only */
- }
-};
-
-#endif /* CONFIG_REDWOOD_6 */
-
struct map_info redwood_flash_map = {
.name = "IBM Redwood",
.size = WINDOW_SIZE,
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index ce2fcdd..313d306 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -913,7 +913,7 @@ config SMC91X
tristate "SMC 91C9x/91C1xxx support"
select CRC32
select MII
- depends on ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH || \
+ depends on ARM || M32R || SUPERH || \
MIPS || BLACKFIN || MN10300 || COLDFIRE
help
This is a driver for SMC's 91x series of Ethernet chipsets,
--
1.7.0.4
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [5/5] Remove REDWOOD_5 and REDWOOD_6 config options and conditional code
2010-07-14 14:05 [PATCH 5/5] Remove REDWOOD_5 and REDWOOD_6 config options and conditional code Christian Dietrich
@ 2010-07-15 7:42 ` Milton Miller
2010-07-16 12:28 ` [PATCH 0/2] Removing dead code Christian Dietrich
0 siblings, 1 reply; 5+ messages in thread
From: Milton Miller @ 2010-07-15 7:42 UTC (permalink / raw)
To: Christian Dietrich
Cc: Josh Boyer, Matt Porter, Benjamin Herrenschmidt, Paul Mackerras,
Solomon Peachy, David Woodhouse, Mike Frysinger, Jiri Kosina,
Artem Bityutskiy, Alexander Kurz, John Linn, David S. Miller,
Randy Dunlap, Florian Fainelli, linuxppc-dev, linux-kernel,
linux-mtd, netdev, vamos-dev
On Wed, 14 Jul 2010 about 04:05:05 -0000, Christian Dietrich wrote:
>
> The config options for REDWOOD_[56] were commented out in the powerpc
> Kconfig. The ifdefs referencing this options therefore are dead and all
> references to this can be removed (Also dependencies in other KConfig
> files).
>
> Signed-off-by: Christian Dietrich <qy03fugy@stud.informatik.uni-erlangen.de>
>
> ---
> arch/powerpc/platforms/40x/Kconfig | 16 -------------
> drivers/mtd/maps/Kconfig | 2 +-
> drivers/mtd/maps/redwood.c | 43 ------------------------------------
> drivers/net/Kconfig | 2 +-
> 4 files changed, 2 insertions(+), 61 deletions(-)
> diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
> index f22bc9f..b5ebb72 100644
> --- a/drivers/mtd/maps/Kconfig
> +++ b/drivers/mtd/maps/Kconfig
> @@ -321,7 +321,7 @@ config MTD_CFI_FLAGADM
>
> config MTD_REDWOOD
> tristate "CFI Flash devices mapped on IBM Redwood"
> - depends on MTD_CFI && ( REDWOOD_4 || REDWOOD_5 || REDWOOD_6 )
> + depends on MTD_CFI && REDWOOD_4
> help
> This enables access routines for the flash chips on the IBM
> Redwood board. If you have one of these boards and would like to
REDWOOD_4 does not appear to be in the tree either so this mapping driver
should be deleted if the patch is otherwise acceptable. Besides we
would express the info contained in this simple map driver the device tree
using physmap_of.
milton
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 0/2] Removing dead code
2010-07-15 7:42 ` [5/5] " Milton Miller
@ 2010-07-16 12:28 ` Christian Dietrich
0 siblings, 0 replies; 5+ messages in thread
From: Christian Dietrich @ 2010-07-16 12:28 UTC (permalink / raw)
To: Milton Miller, Josh Boyer, Matt Porter, Benjamin Herrenschmidt,
Paul Mackerras, Solomon Peachy, David Woodhouse, Mike Frysinger,
Jiri Kosina, Artem Bityutskiy, Alexander Kurz, Russell King,
Ralf Baechle, Manuel Lauss, David S. Miller, Randy Dunlap,
John Linn, Florian Fainelli, Nicolas Pitre, Joe Perches,
Ladislav Michl, David Brown, linuxppc-dev, linux-kernel,
linux-mtd, netdev
Cc: vamos-dev
Hi all!
I merged the two patches from Christoph Egger[1] to remove the
REDWOOD_[456] config depends. And wrote a second patch, which removes
the redwood/mtd mapping module. I hope this is now acceptable to bring
it into the kernel, if this options are really dead.
Regards
Christian Dietrich
[0] http://vamos1.informatik.uni-erlangen.de/
[1] Message-Id: <adba61f63f4439ac17f2e428429f01ae5e65ab15.1279110895.git.siccegge@cs.fau.de>
Christian Dietrich (2):
Remove REDWOOD_[456] config options and conditional code
Removed redwood/mtd mapping
arch/powerpc/platforms/40x/Kconfig | 16 ----
drivers/mtd/maps/Kconfig | 8 --
drivers/mtd/maps/Makefile | 1 -
drivers/mtd/maps/redwood.c | 174 ------------------------------------
drivers/net/Kconfig | 2 +-
drivers/net/smc91x.h | 37 --------
6 files changed, 1 insertions(+), 237 deletions(-)
delete mode 100644 drivers/mtd/maps/redwood.c
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 0/2] Removing dead code
@ 2010-08-23 9:59 Christian Dietrich
0 siblings, 0 replies; 5+ messages in thread
From: Christian Dietrich @ 2010-08-23 9:59 UTC (permalink / raw)
To: Tejun Heo, Jiri Kosina, Daniel Mack, Joseph Chan,
Florian Tobias Schandinat, Andrew Morton, Jonathan Corbet,
Erik-Jan Post, linux-kernel, 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 drivers/video sourcetree for
config Items not defined in Kconfig and found 2 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 (2):
drivers/video: Removing dead FB_VIA_CAMERA config option
drivers/video: Removing dead FB_68328_INVERT config option
drivers/video/68328fb.c | 4 ----
drivers/video/via/accel.c | 16 ----------------
include/linux/via-core.h | 5 +----
3 files changed, 1 insertions(+), 24 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-08-23 9:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-28 13:40 [PATCH 0/2] Removing dead code Christoph Egger
2010-06-28 13:41 ` [PATCH 1/2] Removing dead CONFIG_PARAVIRT_GUEST_ASM_CLOBBER_CHECK Christoph Egger
2010-06-28 13:41 ` [PATCH 2/2] Removing dead CONFIG_IOMMU_DEBUG Christoph Egger
2010-07-14 14:05 [PATCH 5/5] Remove REDWOOD_5 and REDWOOD_6 config options and conditional code Christian Dietrich
2010-07-15 7:42 ` [5/5] " Milton Miller
2010-07-16 12:28 ` [PATCH 0/2] Removing dead code Christian Dietrich
2010-08-23 9:59 Christian Dietrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome