From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Prabhakar Lad <prabhakar.csengg@gmail.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>,
LFBDEV <linux-fbdev@vger.kernel.org>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] fbdev: ssd1307fb: check return value while setting offset
Date: Tue, 13 Jan 2015 13:39:03 +0000 [thread overview]
Message-ID: <20150113133903.GV4891@lukather> (raw)
In-Reply-To: <CA+V-a8u0RARw84FYa661VZCYpXkZYkXmtc03jCXU=t0aoGvg9Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1626 bytes --]
On Tue, Jan 13, 2015 at 11:53:01AM +0000, Prabhakar Lad wrote:
> On Tue, Jan 13, 2015 at 11:43 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> > On 08/01/15 10:17, Lad, Prabhakar wrote:
> >> this patch checks the return value of write command while
> >> setting the display offset.
> >>
> >> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
> >> ---
> >> drivers/video/fbdev/ssd1307fb.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
> >> index 70e3ce8..a7ecaa6 100644
> >> --- a/drivers/video/fbdev/ssd1307fb.c
> >> +++ b/drivers/video/fbdev/ssd1307fb.c
> >> @@ -342,7 +342,7 @@ static int ssd1307fb_ssd1306_init(struct ssd1307fb_par *par)
> >>
> >> /* set display offset value */
> >> ret = ssd1307fb_write_cmd(par->client, SSD1307FB_SET_DISPLAY_OFFSET);
> >> - ret = ssd1307fb_write_cmd(par->client, 0x20);
> >> + ret = ret & ssd1307fb_write_cmd(par->client, 0x20);
> >> if (ret < 0)
> >> return ret;
> >
> > Hrm, what's that supposed to do? If both calls to ssd1307fb_write_cmd()
> > return an error, they are anded, resulting in a garbage error code...
> >
> Agreed I have just aligned this to rest of the code in this function.
>
> Maxime if you are OK I'll post a patch returning error then and there ?
I'm not sure what the question is, but Tomi is right, having two
returns seems the right thing to do.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Prabhakar Lad <prabhakar.csengg@gmail.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>,
LFBDEV <linux-fbdev@vger.kernel.org>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] fbdev: ssd1307fb: check return value while setting offset
Date: Tue, 13 Jan 2015 14:39:03 +0100 [thread overview]
Message-ID: <20150113133903.GV4891@lukather> (raw)
In-Reply-To: <CA+V-a8u0RARw84FYa661VZCYpXkZYkXmtc03jCXU=t0aoGvg9Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1626 bytes --]
On Tue, Jan 13, 2015 at 11:53:01AM +0000, Prabhakar Lad wrote:
> On Tue, Jan 13, 2015 at 11:43 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> > On 08/01/15 10:17, Lad, Prabhakar wrote:
> >> this patch checks the return value of write command while
> >> setting the display offset.
> >>
> >> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
> >> ---
> >> drivers/video/fbdev/ssd1307fb.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
> >> index 70e3ce8..a7ecaa6 100644
> >> --- a/drivers/video/fbdev/ssd1307fb.c
> >> +++ b/drivers/video/fbdev/ssd1307fb.c
> >> @@ -342,7 +342,7 @@ static int ssd1307fb_ssd1306_init(struct ssd1307fb_par *par)
> >>
> >> /* set display offset value */
> >> ret = ssd1307fb_write_cmd(par->client, SSD1307FB_SET_DISPLAY_OFFSET);
> >> - ret = ssd1307fb_write_cmd(par->client, 0x20);
> >> + ret = ret & ssd1307fb_write_cmd(par->client, 0x20);
> >> if (ret < 0)
> >> return ret;
> >
> > Hrm, what's that supposed to do? If both calls to ssd1307fb_write_cmd()
> > return an error, they are anded, resulting in a garbage error code...
> >
> Agreed I have just aligned this to rest of the code in this function.
>
> Maxime if you are OK I'll post a patch returning error then and there ?
I'm not sure what the question is, but Tomi is right, having two
returns seems the right thing to do.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-01-13 13:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 8:17 [PATCH 0/2] fbdev: ssd1307fb: fixes Lad, Prabhakar
2015-01-08 8:17 ` Lad, Prabhakar
2015-01-08 8:17 ` [PATCH 1/2] fbdev: ssd1307fb: set default height if not found in DT node Lad, Prabhakar
2015-01-08 8:17 ` Lad, Prabhakar
2015-01-08 9:31 ` Maxime Ripard
2015-01-08 9:31 ` Maxime Ripard
2015-01-15 11:27 ` Tomi Valkeinen
2015-01-15 11:27 ` Tomi Valkeinen
2015-01-08 8:17 ` [PATCH 2/2] fbdev: ssd1307fb: check return value while setting offset Lad, Prabhakar
2015-01-08 8:17 ` Lad, Prabhakar
2015-01-08 9:32 ` Maxime Ripard
2015-01-08 9:32 ` Maxime Ripard
2015-01-13 11:43 ` Tomi Valkeinen
2015-01-13 11:43 ` Tomi Valkeinen
2015-01-13 11:53 ` Prabhakar Lad
2015-01-13 13:39 ` Maxime Ripard [this message]
2015-01-13 13:39 ` Maxime Ripard
2015-01-13 13:46 ` Prabhakar Lad
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=20150113133903.GV4891@lukather \
--to=maxime.ripard@free-electrons.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=plagnioj@jcrosoft.com \
--cc=prabhakar.csengg@gmail.com \
--cc=tomi.valkeinen@ti.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.