Skip to contentSkip to conversation

LinuxCPD - New mini project

Kernel-janitors Aaron Grothe 3 participants 3 messages Sep 29, 2004 Kernel janitors

lore
Share & tools
lore
#0 lore raw

Hi,

I've put a small project up at Sourceforge http://linuxcpd.sf.net

The project is called LinuxCPD for Linux Cut and Paste Detection. The goal of the project is to hopefully lead to some refactoring of the kernel and reducing the amount of Cut and Pasted code in the kernel.

It runs Red Hill consulting's Simian tool against the 2.4 and 2.6 kernel and reports all sections of code that are duplicated that are larger than 50 lines. Looking at I'm happily surprised about how much less duplicated code there appears to be in the 2.6 kernel series.

If anybody has any ideas or suggestions on how to make this tool more useful I would be very appreciative.

Regards,

Aaron
=-=-=
"The Journey is the Reward" - Old Zen Buddhist Saying

__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw
Quoted 4 lines · Aaron Grothe

I've put a small project up at Sourceforge http://linuxcpd.sf.net

Looking at I'm happily surprised about
how much less duplicated code there appears to be in the 2.6 kernel series.

Generally a good thing. It does reveal quite a few duplications between ppc and ppc64 trees which might be worth pursuing sometime.

Jon.

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#2 lore raw
In reply to Aaron Grothe
Quoted 7 lines · Jon Masters
Quoted 4 lines · Aaron Grothe

I've put a small project up at Sourceforge http://linuxcpd.sf.net

Looking at I'm happily surprised about
how much less duplicated code there appears to be in the 2.6 kernel series.

Much of the improvements can probably be attributed to merging the 64 bit subarchitectures of mips and s390 into their respective 32 bit trees.

Quoted 2 lines

Generally a good thing. It does reveal quite a few duplications between ppc and ppc64 trees which might be worth pursuing sometime.

It may not be a good idea to follow the same route as mips and s390 for ppc64 and completely get rid of the 64 bit tree, because the ppc64 tree already doesn't need much of the legacy code in ppc. OTOH, it would be nice to share the include/asm tree in order to simplify life for multilib build environments. For arch/ppc*/, we could follow the approach of x86_64, where the files with identical functionality are simply built in the arch/i386 tree. See the patch below for a trivial example of this (these two files are already identical on ppc and ppc64).
Unifying the xmon directory could be something more interesting.

	Arnd <><
arch/ppc64/lib/Makefile +4 -1
diff -u -r1.2 Makefile
@@ -2,8 +2,11 @@
 # Makefile for ppc64-specific library files..
 #
 
-lib-y := checksum.o dec_and_lock.o string.o strcase.o
+lib-y := checksum.o string.o 
 lib-y += copypage.o memcpy.o copyuser.o
+
+obj-y += ppclib.o
+ppclib-y := $(addprefix ../../ppc/lib/,dec_and_lock.o strcase.o)
 
 # Lock primitives are defined as no-ops in include/linux/spinlock.h
 # for non-SMP configs. Don't build the real versions.

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors