From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757330Ab2CLVEr (ORCPT ); Mon, 12 Mar 2012 17:04:47 -0400 Received: from avon.wwwdotorg.org ([70.85.31.133]:48042 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756673Ab2CLVEq (ORCPT ); Mon, 12 Mar 2012 17:04:46 -0400 Message-ID: <4F5E64EB.6050200@wwwdotorg.org> Date: Mon, 12 Mar 2012 15:04:43 -0600 From: Stephen Warren User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110921 Thunderbird/3.1.15 MIME-Version: 1.0 To: Linus Walleij CC: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Shawn Guo , Thomas Abraham , Dong Aisheng , Rajendra Nayak , Haojian Zhuang , Linus Walleij Subject: Re: [PATCH] pinctrl: fix error path in pinconf_map_to_setting() References: <1331584870-10077-1-git-send-email-linus.walleij@stericsson.com> In-Reply-To: <1331584870-10077-1-git-send-email-linus.walleij@stericsson.com> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/12/2012 02:41 PM, Linus Walleij wrote: > From: Linus Walleij > > The code was using the union member > setting->data.configs.group_or_pin to store a potential > error code, but since that member is unsigned the > < 0 comparison was not true, letting errors pass thru, "thru" is a pet peeve of mine; it'd be great to spell this correctly as "through". > ending up as mapped to pin "-22". Fix this up and print > the error. Oops. Sorry about that. > Signed-off-by: Linus Walleij ... > - setting->data.configs.group_or_pin = > - pin_get_from_name(pctldev, > - map->data.configs.group_or_pin); > - if (setting->data.configs.group_or_pin < 0) > - return setting->data.configs.group_or_pin; > + ret = pin_get_from_name(pctldev, > + map->data.configs.group_or_pin); > + if (ret < 0) { "ret" here is named "pin" other places pin_get_from_name() is called, and that naming seems to make a bit more sense here too. Otherwise, Acked-by: Stephen Warren