From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: kernel-janitors@vger.kernel.org, linux-fbdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 04/11] fbdev: ssd1307fb: fix error return code
Date: Tue, 01 Sep 2015 10:39:55 +0000 [thread overview]
Message-ID: <55E5807B.1020505@ti.com> (raw)
In-Reply-To: <1440288682-12732-5-git-send-email-Julia.Lawall@lip6.fr>
[-- Attachment #1: Type: text/plain, Size: 1448 bytes --]
On 23/08/15 03:11, Julia Lawall wrote:
> Propagate error code on failure. Also changed %ld to %d in dev_err to use
> ret variable rather than putting two calls to PTR_ERR.
>
> A simplified version of the semantic match that finds the first problem is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> identifier ret; expression e1,e2;
> @@
> (
> if (\(ret < 0\|ret != 0\))
> { ... return ret; }
> |
> ret = 0
> )
> ... when != ret = e1
> when != &ret
> *if(...)
> {
> ... when != ret = e2
> when forall
> return ret;
> }
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
> drivers/video/fbdev/ssd1307fb.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
> index 3e153c0..1611215 100644
> --- a/drivers/video/fbdev/ssd1307fb.c
> +++ b/drivers/video/fbdev/ssd1307fb.c
> @@ -656,8 +656,9 @@ static int ssd1307fb_probe(struct i2c_client *client,
> bl = backlight_device_register(bl_name, &client->dev, par,
> &ssd1307fb_bl_ops, NULL);
> if (IS_ERR(bl)) {
> - dev_err(&client->dev, "unable to register backlight device: %ld\n",
> - PTR_ERR(bl));
> + ret = PTR_ERR(bl);
> + dev_err(&client->dev, "unable to register backlight device: %d\n",
> + ret);
> goto bl_init_error;
> }
Thanks, queued for 4.3.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: <kernel-janitors@vger.kernel.org>, <linux-fbdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 04/11] fbdev: ssd1307fb: fix error return code
Date: Tue, 1 Sep 2015 13:39:55 +0300 [thread overview]
Message-ID: <55E5807B.1020505@ti.com> (raw)
In-Reply-To: <1440288682-12732-5-git-send-email-Julia.Lawall@lip6.fr>
[-- Attachment #1: Type: text/plain, Size: 1448 bytes --]
On 23/08/15 03:11, Julia Lawall wrote:
> Propagate error code on failure. Also changed %ld to %d in dev_err to use
> ret variable rather than putting two calls to PTR_ERR.
>
> A simplified version of the semantic match that finds the first problem is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> identifier ret; expression e1,e2;
> @@
> (
> if (\(ret < 0\|ret != 0\))
> { ... return ret; }
> |
> ret = 0
> )
> ... when != ret = e1
> when != &ret
> *if(...)
> {
> ... when != ret = e2
> when forall
> return ret;
> }
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
> drivers/video/fbdev/ssd1307fb.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
> index 3e153c0..1611215 100644
> --- a/drivers/video/fbdev/ssd1307fb.c
> +++ b/drivers/video/fbdev/ssd1307fb.c
> @@ -656,8 +656,9 @@ static int ssd1307fb_probe(struct i2c_client *client,
> bl = backlight_device_register(bl_name, &client->dev, par,
> &ssd1307fb_bl_ops, NULL);
> if (IS_ERR(bl)) {
> - dev_err(&client->dev, "unable to register backlight device: %ld\n",
> - PTR_ERR(bl));
> + ret = PTR_ERR(bl);
> + dev_err(&client->dev, "unable to register backlight device: %d\n",
> + ret);
> goto bl_init_error;
> }
Thanks, queued for 4.3.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-09-01 10:39 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-23 0:11 [PATCH 00/11] fix error return code Julia Lawall
2015-08-23 0:11 ` Julia Lawall
2015-08-23 0:11 ` Julia Lawall
2015-08-23 0:11 ` Julia Lawall
2015-08-23 0:11 ` [PATCH 01/11] mmc: omap: " Julia Lawall
2015-08-23 0:11 ` Julia Lawall
2015-08-25 15:26 ` Ulf Hansson
2015-08-25 15:26 ` Ulf Hansson
2015-08-23 0:11 ` [PATCH 02/11] soc: ti: knav_qmss_queue: " Julia Lawall
2015-08-23 0:11 ` Julia Lawall
2015-08-23 0:11 ` Julia Lawall
2015-08-23 1:12 ` santosh.shilimkar
2015-08-23 1:12 ` santosh.shilimkar
2015-08-23 1:12 ` santosh.shilimkar at oracle.com
2015-08-23 0:11 ` [PATCH 03/11] net: davinci_emac: " Julia Lawall
2015-08-23 0:11 ` Julia Lawall
2015-08-25 20:39 ` David Miller
2015-08-25 20:39 ` David Miller
2015-08-23 0:11 ` [PATCH 04/11] fbdev: ssd1307fb: " Julia Lawall
2015-08-23 0:11 ` Julia Lawall
2015-09-01 10:39 ` Tomi Valkeinen [this message]
2015-09-01 10:39 ` Tomi Valkeinen
2015-08-23 0:11 ` [PATCH 05/11] mlxsw: " Julia Lawall
2015-08-23 0:11 ` Julia Lawall
2015-08-23 18:52 ` Jiri Pirko
2015-08-23 18:52 ` Jiri Pirko
2015-08-25 20:39 ` David Miller
2015-08-25 20:39 ` David Miller
2015-08-23 0:11 ` [PATCH 06/11] mmc: usdhi6rol0: " Julia Lawall
2015-08-23 0:11 ` Julia Lawall
2015-08-25 15:26 ` Ulf Hansson
2015-08-25 15:26 ` Ulf Hansson
2015-08-23 0:11 ` [PATCH 07/11] drm: " Julia Lawall
2015-08-23 0:11 ` Julia Lawall
2015-08-23 0:11 ` [PATCH 08/11] drm/exynos: mic: " Julia Lawall
2015-08-23 0:11 ` Julia Lawall
2015-08-23 0:11 ` Julia Lawall
2015-08-23 0:11 ` [PATCH 09/11] Input: sur40: " Julia Lawall
2015-08-23 0:11 ` Julia Lawall
2015-08-24 19:30 ` Dmitry Torokhov
2015-08-24 19:30 ` Dmitry Torokhov
2015-08-23 0:11 ` [PATCH 10/11] ah6: " Julia Lawall
2015-08-23 0:11 ` Julia Lawall
2015-08-24 12:13 ` Herbert Xu
2015-08-24 12:13 ` Herbert Xu
2015-08-25 20:39 ` David Miller
2015-08-25 20:39 ` David Miller
2015-08-23 0:11 ` [PATCH 11/11] gpio: xlp: " Julia Lawall
2015-08-23 0:11 ` Julia Lawall
2015-08-26 12:50 ` Linus Walleij
2015-08-26 12:50 ` Linus Walleij
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=55E5807B.1020505@ti.com \
--to=tomi.valkeinen@ti.com \
--cc=Julia.Lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=plagnioj@jcrosoft.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.