Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751864Ab3FXL3l (ORCPT ); Mon, 24 Jun 2013 07:29:41 -0400 Received: from mail-oa0-f49.google.com ([209.85.219.49]:51235 "EHLO mail-oa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750783Ab3FXL3k (ORCPT ); Mon, 24 Jun 2013 07:29:40 -0400 MIME-Version: 1.0 In-Reply-To: <1371737145-27662-2-git-send-email-patrice.chotard.st@gmail.com> References: <1371737145-27662-1-git-send-email-patrice.chotard.st@gmail.com> <1371737145-27662-2-git-send-email-patrice.chotard.st@gmail.com> Date: Mon, 24 Jun 2013 13:29:39 +0200 Message-ID: Subject: Re: [PATCH v2 1/4] pinctrl: abx500: suppress hardcoded value From: Linus Walleij To: Patrice Chotard Cc: "linux-kernel@vger.kernel.org" , Olivier Clergeaud , Lee Jones , Fabio Baltieri , Patrice Chotard Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1125 Lines: 33 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 . Thanks, Linus Walleij -- 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/