linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] video: backlight: adp8870: Fix warn_unused_result warning reported by Stephen Rothwell
@ 2010-10-29 14:54 michael.hennerich
  2010-10-29 19:25 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: michael.hennerich @ 2010-10-29 14:54 UTC (permalink / raw)
  To: akpm
  Cc: linux-kernel, device-drivers-devel, drivers, rpurdie, linux-next,
	sfr, Michael Hennerich

From: Michael Hennerich <michael.hennerich@analog.com>

handle return value, strict_strtoul is declared with attribute warn_unused_result

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/video/backlight/adp8860_bl.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c
index 3ec2460..8746303 100644
--- a/drivers/video/backlight/adp8860_bl.c
+++ b/drivers/video/backlight/adp8860_bl.c
@@ -502,8 +502,10 @@ static ssize_t adp8860_bl_l1_daylight_max_store(struct device *dev,
 		struct device_attribute *attr, const char *buf, size_t count)
 {
 	struct adp8860_bl *data = dev_get_drvdata(dev);
+	int ret = strict_strtoul(buf, 10, &data->cached_daylight_max);
+	if (ret)
+		return ret;
 
-	strict_strtoul(buf, 10, &data->cached_daylight_max);
 	return adp8860_store(dev, buf, count, ADP8860_BLMX1);
 }
 static DEVICE_ATTR(l1_daylight_max, 0664, adp8860_bl_l1_daylight_max_show,
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] video: backlight: adp8870: Fix warn_unused_result warning reported by Stephen Rothwell
  2010-10-29 14:54 [PATCH] video: backlight: adp8870: Fix warn_unused_result warning reported by Stephen Rothwell michael.hennerich
@ 2010-10-29 19:25 ` Andrew Morton
  2010-11-02  7:35   ` [Device-drivers-devel] " Mike Frysinger
  2010-11-02  8:57   ` Hennerich, Michael
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Morton @ 2010-10-29 19:25 UTC (permalink / raw)
  To: michael.hennerich
  Cc: linux-kernel, device-drivers-devel, drivers, rpurdie, linux-next, sfr


I have some bones to gnaw.  Not specific to this patch ;)

On Fri, 29 Oct 2010 16:54:26 +0200
<michael.hennerich@analog.com> wrote:

> Subject: [PATCH] video: backlight: adp8870: Fix warn_unused_result warning reported by Stephen Rothwell

Lots of people are doing this "video: backlight: adp8870:" thing
lately.  And it's good, but why not just use
"drivers/video/backlight/adp8860_bl.c" to identify the affected
susbsytem/file/etc?  It's simple and uniform.  It's not always the
appropriate thing to do, but replacing the /'s with ": " seems rather
random and pointless.

Secondly, no, the point of this patch is not to fix a
warn_unused_result() warning!  The patch actually fixes a bug: the code
wasn't checking the strict_strtoul() return value.  The warning is
simply what alerted us to the bug.

So I renamed this patch to

	drivers/video/backlight/adp8860_bl.c: check strict_strtoul() return value

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Device-drivers-devel] [PATCH] video: backlight: adp8870: Fix warn_unused_result warning reported by Stephen Rothwell
  2010-10-29 19:25 ` Andrew Morton
@ 2010-11-02  7:35   ` Mike Frysinger
  2010-11-02  8:57   ` Hennerich, Michael
  1 sibling, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2010-11-02  7:35 UTC (permalink / raw)
  To: Andrew Morton
  Cc: michael.hennerich, drivers, sfr, linux-kernel, linux-next,
	rpurdie, device-drivers-devel

On Fri, Oct 29, 2010 at 15:25, Andrew Morton wrote:
>> Subject: [PATCH] video: backlight: adp8870: Fix warn_unused_result warning reported by Stephen Rothwell
>
> Lots of people are doing this "video: backlight: adp8870:" thing
> lately.  And it's good, but why not just use
> "drivers/video/backlight/adp8860_bl.c" to identify the affected
> susbsytem/file/etc?  It's simple and uniform.  It's not always the
> appropriate thing to do, but replacing the /'s with ": " seems rather
> random and pointless.

the colons and spaces make it a lot easier to pick out in a git log.
your suggestion makes it much harder to read due to the lack of
whitespace.
-mike

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] video: backlight: adp8870: Fix warn_unused_result warning reported by Stephen Rothwell
  2010-10-29 19:25 ` Andrew Morton
  2010-11-02  7:35   ` [Device-drivers-devel] " Mike Frysinger
@ 2010-11-02  8:57   ` Hennerich, Michael
  1 sibling, 0 replies; 4+ messages in thread
From: Hennerich, Michael @ 2010-11-02  8:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, device-drivers-devel, Drivers, rpurdie, linux-next, sfr

Andrew Morton wrote on 2010-10-29:
>
> I have some bones to gnaw.  Not specific to this patch ;)
>
> On Fri, 29 Oct 2010 16:54:26 +0200
> <michael.hennerich@analog.com> wrote:
>
>> Subject: [PATCH] video: backlight: adp8870: Fix warn_unused_result
>> warning reported by Stephen Rothwell
>
> Lots of people are doing this "video: backlight: adp8870:" thing
> lately.  And it's good, but why not just use
> "drivers/video/backlight/adp8860_bl.c" to identify the affected
> susbsytem/file/etc?  It's simple and uniform.  It's not always the
> appropriate thing to do, but replacing the /'s with ": " seems rather
> random and pointless.

Think it's easier to read, or better skip reading further.

> Secondly, no, the point of this patch is not to fix a
> warn_unused_result() warning!  The patch actually fixes a bug: the
> code wasn't checking the strict_strtoul() return value.  The warning
> is simply what alerted us to the bug.
>
> So I renamed this patch to
>
>       drivers/video/backlight/adp8860_bl.c: check strict_strtoul() return
> value

Agreed - Thanks for fixing it.

Greetings,
Michael

Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 4036 Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-02  8:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-29 14:54 [PATCH] video: backlight: adp8870: Fix warn_unused_result warning reported by Stephen Rothwell michael.hennerich
2010-10-29 19:25 ` Andrew Morton
2010-11-02  7:35   ` [Device-drivers-devel] " Mike Frysinger
2010-11-02  8:57   ` Hennerich, Michael

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).