From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by ozlabs.org (Postfix) with ESMTP id 35274DDE31 for ; Thu, 14 Jun 2007 01:09:27 +1000 (EST) Received: by wa-out-1112.google.com with SMTP id m28so281136wag for ; Wed, 13 Jun 2007 08:09:26 -0700 (PDT) Message-ID: Date: Wed, 13 Jun 2007 09:09:25 -0600 From: "Grant Likely" Sender: glikely@secretlab.ca To: "Alan Stern" Subject: Re: [linux-usb-devel] [PATCH 6/6] [C67x00] Merge c67x00-hub.c into c67x00-hcd.c In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed References: Cc: Peter Korsgaard , linux-usb-devel@lists.sourceforge.net, linuxppc-embedded@ozlabs.org List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 6/13/07, Alan Stern wrote: > On Wed, 13 Jun 2007, Grant Likely wrote: > > > On 6/12/07, Peter Korsgaard wrote: > > > >>>>> "Grant" == Grant Likely writes: > > > > > > Hi, > > > > > > Grant> Rather than c67x00-hub.c being compiled seperately, the > > > Grant> original code had c67x00-hub.c *included* by c67x00-hcd.c. > > > Grant> This is a very bad idea. > > What's so bad about it? It's an elegant solution to the problem of > breaking a very long driver up into smaller, more digestible pieces > without polluting the kernel's namespace with lots of extra global > symbols. Primarily because it breaks convention. Convention is that you #include .h files, and you compile and link .c files. Convention is important because it reflects the common patterns we use when reading and writing (but mostly reading) code. Yes there are exceptions, and yes it can be done, but there better be a damn good reason for doing so. In this particular case, I really don't think it is warranted. We're not talking about a great deal of code, and we're *already* polluting the kernel namespace with c67x00_* function names because the driver is already in multiple pieces. This issue has also come up on the LKML also. See this thread: http://thread.gmane.org/gmane.linux.kernel/498633 > What's so ugly about breaking a driver up into pieces? Leaving it in > one giant piece would be much more ugly IMO. Breaking into pieces: Good, and I fully agree. Doing it in non-standard way: Not so good as it trades one kind of ugliness for another. Cheers, g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. grant.likely@secretlab.ca (403) 399-0195