Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1458650 > unrolled thread

[PATCH] rtc: pcf2123: Add missing error code assignment before test

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2016-08-09 14:00 +0200
Last post2016-08-09 14:20 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] rtc: pcf2123: Add missing error code assignment before test Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-08-09 14:00 +0200
    Re: [PATCH] rtc: pcf2123: Add missing error code assignment before  test Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-08-09 14:10 +0200
    Re: [PATCH] rtc: pcf2123: Add missing error code assignment before  test Julia Lawall <julia.lawall@lip6.fr> - 2016-08-09 14:20 +0200
      Re: [rtc-linux] Re: [PATCH] rtc: pcf2123: Add missing error code  assignment before test Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-08-09 14:20 +0200

#1458650 — [PATCH] rtc: pcf2123: Add missing error code assignment before test

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2016-08-09 14:00 +0200
Subject[PATCH] rtc: pcf2123: Add missing error code assignment before test
Message-ID<s4dRo-752-35@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1458653 — Re: [PATCH] rtc: pcf2123: Add missing error code assignment before test

FromAlexandre Belloni <alexandre.belloni@free-electrons.com>
Date2016-08-09 14:10 +0200
SubjectRe: [PATCH] rtc: pcf2123: Add missing error code assignment before test
Message-ID<s4e13-7nY-13@gated-at.bofh.it>
In reply to#1458650
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

[toc] | [prev] | [next] | [standalone]


#1458659 — Re: [PATCH] rtc: pcf2123: Add missing error code assignment before test

FromJulia Lawall <julia.lawall@lip6.fr>
Date2016-08-09 14:20 +0200
SubjectRe: [PATCH] rtc: pcf2123: Add missing error code assignment before test
Message-ID<s4eaK-7rr-19@gated-at.bofh.it>
In reply to#1458650

[Multipart message — attachments visible in raw view] — view raw

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
>

[toc] | [prev] | [next] | [standalone]


#1458660 — Re: [rtc-linux] Re: [PATCH] rtc: pcf2123: Add missing error code assignment before test

FromAlexandre Belloni <alexandre.belloni@free-electrons.com>
Date2016-08-09 14:20 +0200
SubjectRe: [rtc-linux] Re: [PATCH] rtc: pcf2123: Add missing error code assignment before test
Message-ID<s4eaK-7rr-21@gated-at.bofh.it>
In reply to#1458659
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web