* [PATCH 0/3] Removing dead code
@ 2010-07-29 15:28 Christoph Egger
2010-07-29 15:28 ` [PATCH 1/3] Removing dead PROC_MM Christoph Egger
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Christoph Egger @ 2010-07-29 15:28 UTC (permalink / raw)
To: Jeff Dike, Andrew Morton, Christoph Hellwig,
user-mode-linux-devel, linux-kernel
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 arch/um sourcetree for config
Items not defined in Kconfig and found 10 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. As reported earlier
today the build currently fails for plain um but adding this patchset
doesn't change the failing in any way. That was a i386 build.
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 (3):
Removing dead PROC_MM
Removing conditionalizing containing exactly the same code
Removing dead copy&paste code
arch/um/kernel/ptrace.c | 21 ---------------------
arch/um/sys-i386/asm/archparam.h | 4 ----
arch/um/sys-i386/shared/sysdep/system.h | 11 +----------
arch/um/sys-ppc/misc.S | 6 ------
arch/um/sys-ppc/shared/sysdep/ptrace.h | 5 +----
arch/um/sys-x86_64/shared/sysdep/system.h | 10 +---------
6 files changed, 3 insertions(+), 54 deletions(-)
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 1/3] Removing dead PROC_MM
2010-07-29 15:28 [PATCH 0/3] Removing dead code Christoph Egger
@ 2010-07-29 15:28 ` Christoph Egger
2010-07-29 15:29 ` [PATCH 2/3] Removing conditionalizing containing exactly the same code Christoph Egger
2010-07-29 15:29 ` [PATCH 3/3] Removing dead copy&paste code Christoph Egger
2 siblings, 0 replies; 6+ messages in thread
From: Christoph Egger @ 2010-07-29 15:28 UTC (permalink / raw)
To: Jeff Dike, Andrew Morton, Christoph Hellwig,
user-mode-linux-devel, linux-kernel
Cc: vamos-dev
PROC_MM doesn't exist in Kconfig. Looking around it looks like a
left-over from 2.6.0 or even 2.4 times, last mentioned in a fedora
patch for 2.6.10. I believe it's time to get rid of that last tiny
parts here that are still around.
Signed-off-by: Christoph Egger <siccegge@cs.fau.de>
---
arch/um/kernel/ptrace.c | 21 ---------------------
1 files changed, 0 insertions(+), 21 deletions(-)
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c
index 4845099..e051049 100644
--- a/arch/um/kernel/ptrace.c
+++ b/arch/um/kernel/ptrace.c
@@ -7,9 +7,6 @@
#include "linux/ptrace.h"
#include "linux/sched.h"
#include "asm/uaccess.h"
-#ifdef CONFIG_PROC_MM
-#include "proc_mm.h"
-#endif
#include "skas_ptrace.h"
@@ -158,24 +155,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
break;
}
#endif
-#ifdef CONFIG_PROC_MM
- case PTRACE_SWITCH_MM: {
- struct mm_struct *old = child->mm;
- struct mm_struct *new = proc_mm_get_mm(data);
-
- if (IS_ERR(new)) {
- ret = PTR_ERR(new);
- break;
- }
-
- atomic_inc(&new->mm_users);
- child->mm = new;
- child->active_mm = new;
- mmput(old);
- ret = 0;
- break;
- }
-#endif
#ifdef PTRACE_ARCH_PRCTL
case PTRACE_ARCH_PRCTL:
/* XXX Calls ptrace on the host - needs some SMP thinking */
--
1.7.0.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/3] Removing conditionalizing containing exactly the same code
2010-07-29 15:28 [PATCH 0/3] Removing dead code Christoph Egger
2010-07-29 15:28 ` [PATCH 1/3] Removing dead PROC_MM Christoph Egger
@ 2010-07-29 15:29 ` Christoph Egger
2010-07-29 15:29 ` [PATCH 3/3] Removing dead copy&paste code Christoph Egger
2 siblings, 0 replies; 6+ messages in thread
From: Christoph Egger @ 2010-07-29 15:29 UTC (permalink / raw)
To: Jeff Dike, user-mode-linux-devel, linux-kernel; +Cc: vamos-dev
Found this because there's no PPC64 in um, however both branches of
this ifdef contain the exactly same code (modulo comment).
Signed-off-by: Christoph Egger <siccegge@cs.fau.de>
---
arch/um/sys-ppc/shared/sysdep/ptrace.h | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/arch/um/sys-ppc/shared/sysdep/ptrace.h b/arch/um/sys-ppc/shared/sysdep/ptrace.h
index 0e3230e..4ae9be9 100644
--- a/arch/um/sys-ppc/shared/sysdep/ptrace.h
+++ b/arch/um/sys-ppc/shared/sysdep/ptrace.h
@@ -9,11 +9,8 @@
/* the following taken from <asm-ppc/ptrace.h> */
-#ifdef CONFIG_PPC64
-#define PPC_REG unsigned long /*long*/
-#else
#define PPC_REG unsigned long
-#endif
+
struct sys_pt_regs_s {
PPC_REG gpr[32];
PPC_REG nip;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/3] Removing dead copy&paste code
2010-07-29 15:28 [PATCH 0/3] Removing dead code Christoph Egger
2010-07-29 15:28 ` [PATCH 1/3] Removing dead PROC_MM Christoph Egger
2010-07-29 15:29 ` [PATCH 2/3] Removing conditionalizing containing exactly the same code Christoph Egger
@ 2010-07-29 15:29 ` Christoph Egger
2 siblings, 0 replies; 6+ messages in thread
From: Christoph Egger @ 2010-07-29 15:29 UTC (permalink / raw)
To: Jeff Dike, user-mode-linux-devel, linux-kernel; +Cc: vamos-dev
In arch/um there's a lot of code that is copied from their original
arch (but out of sync) and contains code blocks that are either dead
because these options disappearedd or because the arch/x86 Kconfig
stuff doesn't reach arch/um.
X86_OOSTORE is a bit tricky because it's in itself seemingly available
on arch/um but depends on MTRR which isn't in arch/um.
Signed-off-by: Christoph Egger <siccegge@cs.fau.de>
---
arch/um/sys-i386/asm/archparam.h | 4 ----
arch/um/sys-i386/shared/sysdep/system.h | 11 +----------
arch/um/sys-ppc/misc.S | 6 ------
arch/um/sys-x86_64/shared/sysdep/system.h | 10 +---------
4 files changed, 2 insertions(+), 29 deletions(-)
diff --git a/arch/um/sys-i386/asm/archparam.h b/arch/um/sys-i386/asm/archparam.h
index 2a18a88..b2072c9 100644
--- a/arch/um/sys-i386/asm/archparam.h
+++ b/arch/um/sys-i386/asm/archparam.h
@@ -6,11 +6,7 @@
#ifndef __UM_ARCHPARAM_I386_H
#define __UM_ARCHPARAM_I386_H
-#ifdef CONFIG_X86_PAE
-#define LAST_PKMAP 512
-#else
#define LAST_PKMAP 1024
-#endif
#endif
diff --git a/arch/um/sys-i386/shared/sysdep/system.h b/arch/um/sys-i386/shared/sysdep/system.h
index d1b93c4..be25c95 100644
--- a/arch/um/sys-i386/shared/sysdep/system.h
+++ b/arch/um/sys-i386/shared/sysdep/system.h
@@ -10,12 +10,7 @@
#include <linux/kernel.h>
#include <linux/irqflags.h>
-/* entries in ARCH_DLINFO: */
-#ifdef CONFIG_IA32_EMULATION
-# define AT_VECTOR_SIZE_ARCH 2
-#else
-# define AT_VECTOR_SIZE_ARCH 1
-#endif
+#define AT_VECTOR_SIZE_ARCH 1
extern unsigned long arch_align_stack(unsigned long sp);
@@ -101,11 +96,7 @@ void default_idle(void);
#else
# define smp_rmb() barrier()
#endif
-#ifdef CONFIG_X86_OOSTORE
-# define smp_wmb() wmb()
-#else
# define smp_wmb() barrier()
-#endif
#define smp_read_barrier_depends() read_barrier_depends()
#define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
#else
diff --git a/arch/um/sys-ppc/misc.S b/arch/um/sys-ppc/misc.S
index 1364b7d..962e4af 100644
--- a/arch/um/sys-ppc/misc.S
+++ b/arch/um/sys-ppc/misc.S
@@ -18,15 +18,9 @@
#include <asm/processor.h>
#include "ppc_asm.h"
-#if defined(CONFIG_4xx) || defined(CONFIG_8xx)
-#define CACHE_LINE_SIZE 16
-#define LG_CACHE_LINE_SIZE 4
-#define MAX_COPY_PREFETCH 1
-#else
#define CACHE_LINE_SIZE 32
#define LG_CACHE_LINE_SIZE 5
#define MAX_COPY_PREFETCH 4
-#endif /* CONFIG_4xx || CONFIG_8xx */
.text
diff --git a/arch/um/sys-x86_64/shared/sysdep/system.h b/arch/um/sys-x86_64/shared/sysdep/system.h
index d1b93c4..511241f 100644
--- a/arch/um/sys-x86_64/shared/sysdep/system.h
+++ b/arch/um/sys-x86_64/shared/sysdep/system.h
@@ -11,11 +11,7 @@
#include <linux/irqflags.h>
/* entries in ARCH_DLINFO: */
-#ifdef CONFIG_IA32_EMULATION
-# define AT_VECTOR_SIZE_ARCH 2
-#else
-# define AT_VECTOR_SIZE_ARCH 1
-#endif
+#define AT_VECTOR_SIZE_ARCH 1
extern unsigned long arch_align_stack(unsigned long sp);
@@ -101,11 +97,7 @@ void default_idle(void);
#else
# define smp_rmb() barrier()
#endif
-#ifdef CONFIG_X86_OOSTORE
-# define smp_wmb() wmb()
-#else
# define smp_wmb() barrier()
-#endif
#define smp_read_barrier_depends() read_barrier_depends()
#define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
#else
--
1.7.0.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 0/3] Removing dead code
@ 2010-07-21 12:34 Christian Dietrich
0 siblings, 0 replies; 6+ 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] 6+ messages in thread* [PATCH 0/3] Removing dead code
@ 2010-07-14 11:31 Christian Dietrich
0 siblings, 0 replies; 6+ messages in thread
From: Christian Dietrich @ 2010-07-14 11:31 UTC (permalink / raw)
To: Russell King, David Brownell, Greg Kroah-Hartman, Eric Miao,
Robert Jarzmik, H Hartley Sweeten, André Goddard Rosa,
Tejun Heo, Mike Frysinger, Lothar Wassmann, Michael Hennerich,
Bryan Wu, Andrew Morton, Mike Rapoport, Alexey Dobriyan,
linux-arm-kernel, linux-kernel, linux-usb
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/usb 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):
usb/gadget: Remove dead CONFIG_USB_LANGWELL_OTG
usb/{gadget,host}: Remove dead CONFIG_CPU_PXA27x
usb/host || arch/arm: Remove dead CONFIG_ARCH_KARO
arch/arm/tools/mach-types | 1 -
drivers/usb/gadget/langwell_udc.c | 84 +------------------------------------
drivers/usb/gadget/langwell_udc.h | 5 --
drivers/usb/gadget/pxa27x_udc.c | 16 -------
drivers/usb/host/isp1362.h | 24 +----------
drivers/usb/host/ohci-pxa27x.c | 8 ----
6 files changed, 2 insertions(+), 136 deletions(-)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-07-29 15:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-29 15:28 [PATCH 0/3] Removing dead code Christoph Egger
2010-07-29 15:28 ` [PATCH 1/3] Removing dead PROC_MM Christoph Egger
2010-07-29 15:29 ` [PATCH 2/3] Removing conditionalizing containing exactly the same code Christoph Egger
2010-07-29 15:29 ` [PATCH 3/3] Removing dead copy&paste code Christoph Egger
-- strict thread matches above, loose matches on Subject: below --
2010-07-21 12:34 [PATCH 0/3] Removing dead code Christian Dietrich
2010-07-14 11:31 Christian Dietrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox