Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932342AbWLQSaA (ORCPT ); Sun, 17 Dec 2006 13:30:00 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932337AbWLQSaA (ORCPT ); Sun, 17 Dec 2006 13:30:00 -0500 Received: from nic.NetDirect.CA ([216.16.235.2]:44704 "EHLO rubicon.netdirect.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932342AbWLQS37 (ORCPT ); Sun, 17 Dec 2006 13:29:59 -0500 X-Originating-Ip: 24.148.236.183 Date: Sun, 17 Dec 2006 13:25:16 -0500 (EST) From: "Robert P. J. Day" X-X-Sender: rpjday@localhost.localdomain To: Randy Dunlap cc: Tim Schmielau , Jan Engelhardt , Stefan Richter , Zach Brown , Linux kernel mailing list Subject: Re: lots of code could be simplified by using ARRAY_SIZE() In-Reply-To: <20061217102741.58d2c425.randy.dunlap@oracle.com> Message-ID: References: <2F8F687E-C5E5-4F7D-9585-97DA97AE1376@oracle.com> <4581DAB0.2060505@s5r6.in-berlin.de> <20061217102741.58d2c425.randy.dunlap@oracle.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Net-Direct-Inc-MailScanner-Information: Please contact the ISP for more information X-Net-Direct-Inc-MailScanner: Found to be clean X-Net-Direct-Inc-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-14.754, required 5, ALL_TRUSTED -1.80, BAYES_00 -15.00, RCVD_IN_SORBS_DUL 2.05) X-Net-Direct-Inc-MailScanner-From: rpjday@mindspring.com Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1419 Lines: 38 On Sun, 17 Dec 2006, Randy Dunlap wrote: > On Sun, 17 Dec 2006 13:13:59 -0500 (EST) Robert P. J. Day wrote: > > > > > so here's the end result of my experiment to replace unnecessary > > code snippets with an invocation of the ARRAY_SIZE() macro from > > include/linux/kernel.h. i've attached the script that i ran on the > > entire tree, then (after adding al viro's connector patch), did: > > > > $ make allyesconfig # for the stress factor > > $ make > > > > to see what would happen. > > > > amazingly, the compile worked all the way down to: > > > > AS arch/i386/boot/bootsect.o > > LD arch/i386/boot/bootsect > > AS arch/i386/boot/setup.o > > LD arch/i386/boot/setup > > AS arch/i386/boot/compressed/head.o > > CC arch/i386/boot/compressed/misc.o > > OBJCOPY arch/i386/boot/compressed/vmlinux.bin > > HOSTCC arch/i386/boot/compressed/relocs > > arch/i386/boot/compressed/relocs.c: In function 'sym_type': > > arch/i386/boot/compressed/relocs.c:72: warning: implicit declaration of function 'ARRAY_SIZE' > > That's a userspace program and shouldn't use kernel.h. ah, quite right, my bad. eggnog hangover. rday - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/