* [PATCH] rtc: pcf2123: Add missing error code assignment before test
@ 2016-08-09 11:58 Christophe JAILLET
2016-08-09 12:03 ` Julia Lawall
2016-08-09 12:05 ` Alexandre Belloni
0 siblings, 2 replies; 4+ messages in thread
From: Christophe JAILLET @ 2016-08-09 11:58 UTC (permalink / raw)
To: a.zummo, alexandre.belloni
Cc: rtc-linux, linux-kernel, kernel-janitors, Christophe JAILLET
It is likely that checking the result of 'pcf2123_write_reg' is expected
here.
Also fix a small style issue. The '{' at the beginning of the function
is misplaced.
Fixes: 809b453b76e15 ("rtc: pcf2123: clean up writes to the rtc chip")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/rtc/rtc-pcf2123.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-pcf2123.c b/drivers/rtc/rtc-pcf2123.c
index b4478cc92b55..8895f77726e8 100644
--- a/drivers/rtc/rtc-pcf2123.c
+++ b/drivers/rtc/rtc-pcf2123.c
@@ -182,7 +182,8 @@ static ssize_t pcf2123_show(struct device *dev, struct device_attribute *attr,
}
static ssize_t pcf2123_store(struct device *dev, struct device_attribute *attr,
- const char *buffer, size_t count) {
+ const char *buffer, size_t count)
+{
struct pcf2123_sysfs_reg *r;
unsigned long reg;
unsigned long val;
@@ -199,7 +200,7 @@ static ssize_t pcf2123_store(struct device *dev, struct device_attribute *attr,
if (ret)
return ret;
- pcf2123_write_reg(dev, reg, val);
+ ret = pcf2123_write_reg(dev, reg, val);
if (ret < 0)
return -EIO;
return count;
--
2.7.4
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] rtc: pcf2123: Add missing error code assignment before test
2016-08-09 11:58 [PATCH] rtc: pcf2123: Add missing error code assignment before test Christophe JAILLET
@ 2016-08-09 12:03 ` Julia Lawall
2016-08-09 12:17 ` [rtc-linux] " Alexandre Belloni
2016-08-09 12:05 ` Alexandre Belloni
1 sibling, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2016-08-09 12:03 UTC (permalink / raw)
To: Christophe JAILLET
Cc: a.zummo, alexandre.belloni, rtc-linux, linux-kernel,
kernel-janitors
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1764 bytes --]
On Tue, 9 Aug 2016, Christophe JAILLET wrote:
> It is likely that checking the result of 'pcf2123_write_reg' is expected
> here.
> Also fix a small style issue. The '{' at the beginning of the function
> is misplaced.
They shouldn't be in the same patch. If you are wrong about the ret
issue, the { should still be moved.
julia
>
> Fixes: 809b453b76e15 ("rtc: pcf2123: clean up writes to the rtc chip")
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/rtc/rtc-pcf2123.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/rtc/rtc-pcf2123.c b/drivers/rtc/rtc-pcf2123.c
> index b4478cc92b55..8895f77726e8 100644
> --- a/drivers/rtc/rtc-pcf2123.c
> +++ b/drivers/rtc/rtc-pcf2123.c
> @@ -182,7 +182,8 @@ static ssize_t pcf2123_show(struct device *dev, struct device_attribute *attr,
> }
>
> static ssize_t pcf2123_store(struct device *dev, struct device_attribute *attr,
> - const char *buffer, size_t count) {
> + const char *buffer, size_t count)
> +{
> struct pcf2123_sysfs_reg *r;
> unsigned long reg;
> unsigned long val;
> @@ -199,7 +200,7 @@ static ssize_t pcf2123_store(struct device *dev, struct device_attribute *attr,
> if (ret)
> return ret;
>
> - pcf2123_write_reg(dev, reg, val);
> + ret = pcf2123_write_reg(dev, reg, val);
> if (ret < 0)
> return -EIO;
> return count;
> --
> 2.7.4
>
>
> ---
> L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
> https://www.avast.com/antivirus
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rtc: pcf2123: Add missing error code assignment before test
2016-08-09 11:58 [PATCH] rtc: pcf2123: Add missing error code assignment before test Christophe JAILLET
2016-08-09 12:03 ` Julia Lawall
@ 2016-08-09 12:05 ` Alexandre Belloni
1 sibling, 0 replies; 4+ messages in thread
From: Alexandre Belloni @ 2016-08-09 12:05 UTC (permalink / raw)
To: Christophe JAILLET; +Cc: a.zummo, rtc-linux, linux-kernel, kernel-janitors
On 09/08/2016 at 13:58:27 +0200, Christophe JAILLET wrote :
> It is likely that checking the result of 'pcf2123_write_reg' is expected
> here.
> Also fix a small style issue. The '{' at the beginning of the function
> is misplaced.
>
> Fixes: 809b453b76e15 ("rtc: pcf2123: clean up writes to the rtc chip")
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/rtc/rtc-pcf2123.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
Applied, thanks.
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [rtc-linux] Re: [PATCH] rtc: pcf2123: Add missing error code assignment before test
2016-08-09 12:03 ` Julia Lawall
@ 2016-08-09 12:17 ` Alexandre Belloni
0 siblings, 0 replies; 4+ messages in thread
From: Alexandre Belloni @ 2016-08-09 12:17 UTC (permalink / raw)
To: Julia Lawall
Cc: Christophe JAILLET, a.zummo, rtc-linux, linux-kernel,
kernel-janitors
On 09/08/2016 at 14:03:35 +0200, Julia Lawall wrote :
>
>
> On Tue, 9 Aug 2016, Christophe JAILLET wrote:
>
> > It is likely that checking the result of 'pcf2123_write_reg' is expected
> > here.
> > Also fix a small style issue. The '{' at the beginning of the function
> > is misplaced.
>
> They shouldn't be in the same patch. If you are wrong about the ret
> issue, the { should still be moved.
>
That is true but as it is a really trivial patch, I didn't care that
much.
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-08-09 12:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-09 11:58 [PATCH] rtc: pcf2123: Add missing error code assignment before test Christophe JAILLET
2016-08-09 12:03 ` Julia Lawall
2016-08-09 12:17 ` [rtc-linux] " Alexandre Belloni
2016-08-09 12:05 ` Alexandre Belloni
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).