Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757062AbXITOVu (ORCPT ); Thu, 20 Sep 2007 10:21:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754626AbXITOVm (ORCPT ); Thu, 20 Sep 2007 10:21:42 -0400 Received: from pentafluge.infradead.org ([213.146.154.40]:48018 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752972AbXITOVl (ORCPT ); Thu, 20 Sep 2007 10:21:41 -0400 Date: Thu, 20 Sep 2007 19:54:31 +0530 (IST) From: Satyam Sharma X-X-Sender: satyam@enigma.security.iitk.ac.in To: "Maciej W. Rozycki" cc: Andrew Morton , Antonino Daplas , linux-fbdev-devel@lists.sourceforge.net, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers/video/pmag-ba-fb.c: Improve diagnostics In-Reply-To: Message-ID: References: <20070919172412.725508d0.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1329 Lines: 29 On Thu, 20 Sep 2007, Maciej W. Rozycki wrote: > > Perhaps preinitialising to an error value such as -EINVAL would be of > more sense. This way any error paths lacking initialisation are still > reported as errors, even though the classification might be wrong. Eeee ... at least I wouldn't prefer that. Why not simply use the "int x = x;" trick (which is what uninitialized_var() does) -- it shuts up the warning, and does *nothing* else. The bug will not be hidden, if there's bad misbehaviour happening due to the bug, it will continue to happen that way -- thus bringing our attention to it. Pre-initializing to -EINVAL (or whatever) has the problem that when the bug actually triggers, something unrelated might happen higher up the callchain, and we'd be scratching our heads in a "why are we getting a -EINVAL here?" kind of way ... worse still, we might think that this was _really_ an EINVAL and go about debugging it ... Plus, pre-initializing to -EINVAL (or even 0) will waste some bytes in kernel text size, but no such overhead with uninitialized_var() :-) Satyam - 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/