Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755688AbZJ1Uui (ORCPT ); Wed, 28 Oct 2009 16:50:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755527AbZJ1Uuh (ORCPT ); Wed, 28 Oct 2009 16:50:37 -0400 Received: from outbound.icp-qv1-irony-out2.iinet.net.au ([203.59.1.107]:41937 "EHLO outbound.icp-qv1-irony-out2.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755497AbZJ1Uuh (ORCPT ); Wed, 28 Oct 2009 16:50:37 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjUBABpL6Ep8qNN0/2dsb2JhbAAI2nOEPwQ X-IronPort-AV: E=Sophos;i="4.44,641,1249228800"; d="scan'208";a="575014213" Subject: Re: [PATCH 3/3 v2] at91/atmel-mci: inclusion of sd/mmc driver in at91sam9g45 chip and board From: Ben Nizette To: Andrew Victor Cc: "Thiago A." =?ISO-8859-1?Q?Corr=EAa?= , kernel@avr32linux.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolas Ferre , akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org In-Reply-To: References: <20090930155557.7dae503b@hskinnemoen-d830> <20091028083548.38f1d80c@hskinnemoen-d830> Content-Type: text/plain Date: Thu, 29 Oct 2009 07:50:57 +1100 Message-Id: <1256763057.4362.36.camel@ben-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1096 Lines: 32 On Wed, 2009-10-28 at 21:53 +0200, Andrew Victor wrote: > hi, > > > Then I think it would be best to use GPIO_PIN_NONE. Makes it clear > > what is expected and avoids confusion on what should be the proper > > value. > > I hope I'm not saying non-sense, but even if I am, I guess you can see > > that I'm advocating against the magic numbers :) > > What magic numbers ? I think Thiago was referring to the "-1" in the original patch as the magic number. Leaving the field blank to be initialised to 0 is certainly the cleanest, I agree, but it doesn't actually /work/. On many archs 0 is a valid gpio number; the gpio_is_valid check used throughout the kernel (including atmel-mci.c) looks like static inline int gpio_is_valid(int number) { /* only some non-negative numbers are valid */ return ((unsigned)number) < ARCH_NR_GPIOS; } --Ben. -- 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/