Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751205AbdGMFzf (ORCPT ); Thu, 13 Jul 2017 01:55:35 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:54726 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750854AbdGMFzd (ORCPT ); Thu, 13 Jul 2017 01:55:33 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6DE2E607B8 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=fenglinw@codeaurora.org Subject: Re: [PATCH V1 3/3] pinctrl: qcom: spmi-gpio: Correct power_source range check To: Bjorn Andersson , Linus Walleij Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Gross , David Brown , linux-soc@vger.kernel.org, linux-gpio@vger.kernel.org, collinsd@quicinc.com, aghayal@qti.qualcomm.com, wruan@quicinc.com, kgunda@qti.qualcomm.com References: <20170613061707.13892-1-fenglinw@codeaurora.org> <20170613061707.13892-4-fenglinw@codeaurora.org> <20170712213314.GL1618@tuxbook> From: Fenglin Wu Message-ID: <4095df2e-63c9-93c4-c56b-f501724140d5@codeaurora.org> Date: Thu, 13 Jul 2017 13:55:27 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170712213314.GL1618@tuxbook> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1543 Lines: 44 On 7/13/2017 5:33 AM, Bjorn Andersson wrote: > On Mon 12 Jun 23:16 PDT 2017, fenglinw@codeaurora.org wrote: > >> From: Fenglin Wu >> >> Power source selection in DIG_VIN_CTL is indexed from 0, in the range >> check it shouldn't be equal to the total number of power sources. >> >> Signed-off-by: Fenglin Wu > > Reviewed-by: Bjorn Andersson > > This patch is unrelated to the other patches in the series, when this is > the case it's better to send it on its own. > > Regards, > Bjorn > Sure, I will send it as an independent patch. >> --- >> drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c >> index 581309d..1fd677c 100644 >> --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c >> +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c >> @@ -500,7 +500,7 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin, >> pad->is_enabled = false; >> break; >> case PIN_CONFIG_POWER_SOURCE: >> - if (arg > pad->num_sources) >> + if (arg >= pad->num_sources) >> return -EINVAL; >> pad->power_source = arg; >> break; >> -- >> Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, >> a Linux Foundation Collaborative Project. >> -- Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.