Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 5 Dec 2002 06:18:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 5 Dec 2002 06:18:16 -0500 Received: from holomorphy.com ([66.224.33.161]:17802 "EHLO holomorphy") by vger.kernel.org with ESMTP id ; Thu, 5 Dec 2002 06:18:14 -0500 Date: Thu, 5 Dec 2002 03:25:39 -0800 From: William Lee Irwin III To: torvalds@transmeta.com, linux-kernel@vger.kernel.org, kernel-janitor-discuss@lists.sourceforge.net, jgarzik@pobox.com, miura@da-cha.org, alan@lxorguk.ukuu.org.uk, viro@math.psu.edu, pavel@ucw.cz Subject: Re: [warnings] [2/8] fix uninitialized quot in drivers/serial/core.c Message-ID: <20021205112539.GB18600@holomorphy.com> Mail-Followup-To: William Lee Irwin III , torvalds@transmeta.com, linux-kernel@vger.kernel.org, kernel-janitor-discuss@lists.sourceforge.net, jgarzik@pobox.com, miura@da-cha.org, alan@lxorguk.ukuu.org.uk, viro@math.psu.edu, pavel@ucw.cz References: <0212050252.hdcd1a.b3aUbzb5bCbGc3dkcCd8a1atc20143@holomorphy.com> <0212050252.AaCdAbid6d9cabJbEbmaTdZb7daa.c5a20143@holomorphy.com> <20021205111913.A18253@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021205111913.A18253@flint.arm.linux.org.uk> User-Agent: Mutt/1.3.25i Organization: The Domain of Holomorphy Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1526 Lines: 37 On Thu, Dec 05, 2002 at 02:52:59AM -0800, wli@holomorphy.com wrote: >> Give quot a default value so it's initialized. rmk, this is yours >> to ack. On Thu, Dec 05, 2002 at 11:19:13AM +0000, Russell King wrote: > Why can't we get this obvious compiler bug fixed? I'd rather have > the compiler bug fixed rather than trying to work around the bogus > warning. I'll start talking with rth and drow. I'm not 100% incompetent in luserspace, but gcc is a world unto itself (and some damn dirty code IMHO). On Thu, Dec 05, 2002 at 11:19:13AM +0000, Russell King wrote: > It's obvious that the loop: > for (try = 0; try < 3; try++) > is going to be executed at least once, which will initialise quot. > As for the second hunk, its correct in so far as it'll catch the case > where we can't even do 9600 baud. However, I think we should just > bound the lowest baud rate such that we can always do 9600 baud (and > therefore this function will never return zero.) This is a compiler bug; the rest will follow from that. Also, the sub-9600 baud case of the second hunk can be handled independently from the first hunk. I'll break this out into its second hunk if it's worth sending by itself, as you see fit. Before any of this happens, I'll try it out on more modern gcc's. Bill - 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/