Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262803AbVDAXrE (ORCPT ); Fri, 1 Apr 2005 18:47:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262804AbVDAXrE (ORCPT ); Fri, 1 Apr 2005 18:47:04 -0500 Received: from hobbit.corpit.ru ([81.13.94.6]:52827 "EHLO hobbit.corpit.ru") by vger.kernel.org with ESMTP id S262803AbVDAXq6 (ORCPT ); Fri, 1 Apr 2005 18:46:58 -0500 Message-ID: <424DDD6D.3010204@tls.msk.ru> Date: Sat, 02 Apr 2005 03:46:53 +0400 From: Michael Tokarev Organization: Telecom Service, JSC User-Agent: Debian Thunderbird 1.0 (X11/20050116) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Matt Mackall Cc: linux-kernel , Andrew Morton Subject: Re: [PATCH] quiet ide-cd warning References: <20050401201111.GH15453@waste.org> In-Reply-To: <20050401201111.GH15453@waste.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1488 Lines: 44 Matt Mackall wrote: > This shuts up a potential uninitialized variable warning. Potential warning or potential uninitialized use? The code was right before the change, and if the compiler generates such a warning on it, it's the compiler who should be fixed, not the code: it's obvious the variable can't be used uninitialized here, and moving the things around like that makes the code misleading and hard to understand... /mjt > Signed-off-by: Matt Mackall > > Index: af/drivers/ide/ide-cd.c > =================================================================== > --- af.orig/drivers/ide/ide-cd.c 2005-04-01 11:17:37.000000000 -0800 > +++ af/drivers/ide/ide-cd.c 2005-04-01 11:55:09.000000000 -0800 > @@ -430,7 +430,7 @@ void cdrom_analyze_sense_data(ide_drive_ > #if VERBOSE_IDE_CD_ERRORS > { > int i; > - const char *s; > + const char *s = "bad sense key!"; > char buf[80]; > > printk ("ATAPI device %s:\n", drive->name); > @@ -445,8 +445,6 @@ void cdrom_analyze_sense_data(ide_drive_ > > if (sense->sense_key < ARY_LEN(sense_key_texts)) > s = sense_key_texts[sense->sense_key]; > - else > - s = "bad sense key!"; > > printk("%s -- (Sense key=0x%02x)\n", s, sense->sense_key); > > - 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/