From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752956Ab3FXMOU (ORCPT ); Mon, 24 Jun 2013 08:14:20 -0400 Received: from eu1sys200aog102.obsmtp.com ([207.126.144.113]:57405 "EHLO eu1sys200aog102.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752091Ab3FXMOS convert rfc822-to-8bit (ORCPT ); Mon, 24 Jun 2013 08:14:18 -0400 From: Patrice CHOTARD To: Linus Walleij Cc: Patrice Chotard , "linux-kernel@vger.kernel.org" , Olivier CLERGEAUD , Lee Jones , Fabio Baltieri Date: Mon, 24 Jun 2013 14:13:59 +0200 Subject: Re: [PATCH v2 1/4] pinctrl: abx500: suppress hardcoded value Thread-Topic: [PATCH v2 1/4] pinctrl: abx500: suppress hardcoded value Thread-Index: Ac5w1FE//BuqNJ1dQr2MytQb/mCZsQ== Message-ID: <51C83807.8060705@st.com> References: <1371737145-27662-1-git-send-email-patrice.chotard.st@gmail.com> <1371737145-27662-2-git-send-email-patrice.chotard.st@gmail.com> In-Reply-To: Accept-Language: fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 acceptlanguage: fr-FR, en-US Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/24/2013 01:29 PM, Linus Walleij wrote: > On Thu, Jun 20, 2013 at 4:05 PM, wrote: > >> From: Patrice Chotard >> >> Replace hardcoded value by corresponding #define's. >> >> Signed-off-by: Patrice Chotard > > This is not so good. The commit message is saying it > replaces values by #defines but is actually replacing it > by an enum. > > Then you're in each instance calling > > abx500_gpio_set_bits(struct gpio_chip *chip, u8 reg, > unsigned offset, int val) > > The last argument is a hardware register value, but here you > case an enum abx500_gpio_direction to an integer and pass > to this function. > > It would be better if the patch did what it says: create a > #define for ABX500_GPIO_INPUT and ABX500_GPIO_OUTPUT > locally in drivers/pinctrl/pinctrl-abx500.c and use it locally > instead of touching . Ok, i'll resubmit this > > Thanks, > Linus Walleij