Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 26 Apr 2002 18:35:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 26 Apr 2002 18:35:17 -0400 Received: from [195.63.194.11] ([195.63.194.11]:9227 "EHLO mail.stock-world.de") by vger.kernel.org with ESMTP id ; Fri, 26 Apr 2002 18:35:17 -0400 Message-ID: <3CC9C77C.80609@evision-ventures.com> Date: Fri, 26 Apr 2002 23:32:44 +0200 From: Martin Dalecki User-Agent: Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.0rc1) Gecko/20020419 X-Accept-Language: en-us, pl MIME-Version: 1.0 To: Linus Torvalds CC: Pavel Machek , linux-kernel@vger.kernel.org Subject: Re: [PATCH] 2.5.10 IDE 42 In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Uz.ytkownik Linus Torvalds napisa?: > > On Fri, 26 Apr 2002, Pavel Machek wrote: > >>>+ if (stat & READY_STAT) >>>+ printk("DriveReady "); >>>+ if (stat & WRERR_STAT) >>>+ printk("DeviceFault "); >>>+ if (stat & SEEK_STAT) >>>+ printk("SeekComplete "); >>>+ if (stat & DRQ_STAT) >>>+ printk("DataRequest "); >>>+ if (stat & ECC_STAT) >>>+ printk("CorrectedError "); >>>+ if (stat & INDEX_STAT) >>>+ printk("Index "); >>>+ if (stat & ERR_STAT) >>>+ printk("Error "); >> >>I believe this is actually making it *less* readable. > > > Somewhat agreed. Also, the above is just not the right way to do > printouts. > > I'd suggest rewriting the whole big mess as something like > > #define STAT_STR(x,s) \ > ((stat & x ##_STAT) ? s " " : "") > > ... > > printf("IDE: %s%s%s%s%s%s..\n" > STAT_STR(READY, "DriveReady"), > STAT_STR(WERR, "DeviceFault"), > ... > > which is pretty certain to generate much smaller code (not to mention > smaller sources). Agreed. Making the code more compact was the only reason I was touching those debugging sections in first place. BTW> I'm still puzzled that gcc-3.1 eats C++ like randomly placed variable declarations. Is there someting I did miss in C9X papers maybe? - 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/