From: Jiri Kosina <jikos@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: benjamin.tissoires@redhat.com, briannorris@chromium.org,
dianders@chromium.org, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] HID: i2c-hid: Fix error handling
Date: Mon, 6 Mar 2017 14:17:38 +0100 (CET) [thread overview]
Message-ID: <alpine.LSU.2.20.1703061416160.31814@cbobk.fhfr.pm> (raw)
In-Reply-To: <20170219120759.11162-1-christophe.jaillet@wanadoo.fr>
On Sun, 19 Feb 2017, Christophe JAILLET wrote:
> According to error handling in this function, it is likely that some
> resources should be freed before returning.
> Replace 'return ret', with 'goto err'.
>
> While at it, remove some spaces at the beginning of the lines to be more
> consistent.
>
>
> Fixes: ead0687fe304a ("HID: i2c-hid: support regulator power on/off")
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/hid/i2c-hid/i2c-hid.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> index d5288f3fb5ee..1a57ac2d8524 100644
> --- a/drivers/hid/i2c-hid/i2c-hid.c
> +++ b/drivers/hid/i2c-hid/i2c-hid.c
> @@ -1058,13 +1058,13 @@ static int i2c_hid_probe(struct i2c_client *client,
> }
>
> ihid->pdata.supply = devm_regulator_get(&client->dev, "vdd");
> - if (IS_ERR(ihid->pdata.supply)) {
> - ret = PTR_ERR(ihid->pdata.supply);
> - if (ret != -EPROBE_DEFER)
> - dev_err(&client->dev, "Failed to get regulator: %d\n",
> - ret);
> - return ret;
> - }
> + if (IS_ERR(ihid->pdata.supply)) {
> + ret = PTR_ERR(ihid->pdata.supply);
> + if (ret != -EPROBE_DEFER)
> + dev_err(&client->dev, "Failed to get regulator: %d\n",
> + ret);
> + goto err;
> + }
I don't see any spaces at the beginning of lines in the version that's in
my tree ... o_O?
Therefore I've converted this patch into simple 'return ret -> goto err'
transformation and applied on top for-4.12/i2c-hid.
Thanks,
--
Jiri Kosina
SUSE Labs
prev parent reply other threads:[~2017-03-06 13:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-19 12:07 Christophe JAILLET
2017-02-28 17:21 ` Benjamin Tissoires
2017-03-06 13:17 ` Jiri Kosina [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LSU.2.20.1703061416160.31814@cbobk.fhfr.pm \
--to=jikos@kernel.org \
--cc=benjamin.tissoires@redhat.com \
--cc=briannorris@chromium.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dianders@chromium.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®