Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753021Ab0LQILu (ORCPT ); Fri, 17 Dec 2010 03:11:50 -0500 Received: from cantor2.suse.de ([195.135.220.15]:40142 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752528Ab0LQILt (ORCPT ); Fri, 17 Dec 2010 03:11:49 -0500 Date: Fri, 17 Dec 2010 09:11:47 +0100 Message-ID: From: Takashi Iwai To: Chris Ball Cc: Philip Rakity , Aries Lee , zhangfei gao , Qiming Wu , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] mmc: Test bus-width for old MMC devices (v2) In-Reply-To: <20101217034342.GA19673@void.printf.net> References: <20101216234032.GA17239@void.printf.net> <50D31EC8-BD9E-4920-8CEB-2AD10DF9C5C5@marvell.com> <20101217034342.GA19673@void.printf.net> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1411 Lines: 46 At Fri, 17 Dec 2010 03:43:42 +0000, Chris Ball wrote: > > Hi Philip, > > On Thu, Dec 16, 2010 at 06:33:49PM -0800, Philip Rakity wrote: > > It is not possible for bus_width to be not initialized. This would imply ARRAY_SIZE(bus_widths) is 1. Certainly not true. > > Right, I agree. We should fix the warning anyway. Well, this is always a gray-zone question. One prefers fixing it either via uninitialized_var() or by setting a bogus value. But, this would cover any possible real bug in future. Thus another prefers ignoring it, because it's just a compiler bug (mostly of old gcc). After all, it's up to maintainer, so take as you like :) thanks, Takashi > > We could just initialize by changing > > + unsigned idx, bus_width; > > to > > + unsigned idx, bus_width = 0; > > Okay, I've pushed to mmc-next with that change. > > > I wonder what compiler are you using so we can avoid this issue in future. > > Ah, good point -- I was building with a gcc 4.1.2 ARM cross-compiler, > and using a gcc 4.5.1 cross-build instead avoids the warning. > > Thanks, > > -- > Chris Ball > One Laptop Per Child > -- 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/