linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* staging: line6: pcm.c fix checkpatch issues
@ 2012-11-30 10:57 Laurent Navet
  2012-11-30 10:57 ` [PATCH] " Laurent Navet
  0 siblings, 1 reply; 4+ messages in thread
From: Laurent Navet @ 2012-11-30 10:57 UTC (permalink / raw)
  To: devel; +Cc: line6linux-devel, linux-kernel, gregkh


v2 of my previously sended patches, corrected following
dan carpenter and greg kh comments.

Regards,
Laurent.

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

* [PATCH] staging: line6: pcm.c fix checkpatch issues
  2012-11-30 10:57 staging: line6: pcm.c fix checkpatch issues Laurent Navet
@ 2012-11-30 10:57 ` Laurent Navet
  2012-11-30 13:04   ` [Line6linux-devel] " Stefan Hajnoczi
  0 siblings, 1 reply; 4+ messages in thread
From: Laurent Navet @ 2012-11-30 10:57 UTC (permalink / raw)
  To: devel; +Cc: line6linux-devel, linux-kernel, gregkh, Laurent Navet

fix those checkpatch issues
drivers/staging/line6/pcm.c:84:
	WARNING: simple_strtoul is obsolete, use kstrtoul instead
	call to obsolete simple_strtoul() replaced by kstrtoint()

drivers/staging/line6/pcm.c:423:
	ERROR: switch and case should be at the same indent
	realigns comments

Signed-off-by: Laurent Navet <laurent.navet@gmail.com>
---
 drivers/staging/line6/pcm.c |   30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/line6/pcm.c b/drivers/staging/line6/pcm.c
index 6c1e313..17969c6 100644
--- a/drivers/staging/line6/pcm.c
+++ b/drivers/staging/line6/pcm.c
@@ -49,11 +49,11 @@ static ssize_t pcm_set_impulse_volume(struct device *dev,
 {
 	struct snd_line6_pcm *line6pcm = dev2pcm(dev);
 	int value;
-	int rv;
+	int ret;
 
-	rv = kstrtoint(buf, 10, &value);
-	if (rv < 0)
-		return rv;
+	ret = kstrtoint(buf, 10, &value);
+	if (ret < 0)
+		return ret;
 
 	line6pcm->impulse_volume = value;
 
@@ -81,7 +81,14 @@ static ssize_t pcm_set_impulse_period(struct device *dev,
 				      struct device_attribute *attr,
 				      const char *buf, size_t count)
 {
-	dev2pcm(dev)->impulse_period = simple_strtoul(buf, NULL, 10);
+	int value;
+	int ret;
+
+	ret = kstrtoint(buf, 10, &value);
+	if (ret < 0)
+		return ret;
+
+	dev2pcm(dev)->impulse_period = value;
 	return count;
 }
 
@@ -455,13 +462,12 @@ int line6_init_pcm(struct usb_line6 *line6,
 		ep_write = 0x01;
 		break;
 
-		/* this is for interface_number == 1:
-		   case LINE6_DEVID_TONEPORT_UX2:
-		   case LINE6_DEVID_PODSTUDIO_UX2:
-		   ep_read  = 0x87;
-		   ep_write = 0x00;
-		   break;
-		 */
+	/* this is for interface_number == 1:
+	case LINE6_DEVID_TONEPORT_UX2:
+	case LINE6_DEVID_PODSTUDIO_UX2:
+		ep_read  = 0x87;
+		ep_write = 0x00;
+		break; */
 
 	default:
 		MISSING_CASE;
-- 
1.7.10.4


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

* Re: [Line6linux-devel] [PATCH] staging: line6: pcm.c fix checkpatch issues
  2012-11-30 10:57 ` [PATCH] " Laurent Navet
@ 2012-11-30 13:04   ` Stefan Hajnoczi
  2012-12-12 12:39     ` Laurent Navet
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Hajnoczi @ 2012-11-30 13:04 UTC (permalink / raw)
  To: Laurent Navet; +Cc: devel, Greg Kroah-Hartman, line6linux-devel, linux-kernel

On Fri, Nov 30, 2012 at 11:57 AM, Laurent Navet <laurent.navet@gmail.com> wrote:
> fix those checkpatch issues
> drivers/staging/line6/pcm.c:84:
>         WARNING: simple_strtoul is obsolete, use kstrtoul instead
>         call to obsolete simple_strtoul() replaced by kstrtoint()
>
> drivers/staging/line6/pcm.c:423:
>         ERROR: switch and case should be at the same indent
>         realigns comments
>
> Signed-off-by: Laurent Navet <laurent.navet@gmail.com>
> ---
>  drivers/staging/line6/pcm.c |   30 ++++++++++++++++++------------
>  1 file changed, 18 insertions(+), 12 deletions(-)

Changes are fine.

In the future, please split changes into individual patches.  For example:
Patch 1 - Rename 'rv' to 'ret'
Patch 2 - Replace decprecated simple_strtoul() with kstrtoint() in
pcm_set_impulse_period()
Patch 3 - Realign comment in line6_init_pcm() switch statement

Keeping patches focussed on doing just one thing makes it easier to
revert, bisect, and review them.

Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>

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

* Re: [Line6linux-devel] [PATCH] staging: line6: pcm.c fix checkpatch issues
  2012-11-30 13:04   ` [Line6linux-devel] " Stefan Hajnoczi
@ 2012-12-12 12:39     ` Laurent Navet
  0 siblings, 0 replies; 4+ messages in thread
From: Laurent Navet @ 2012-12-12 12:39 UTC (permalink / raw)
  To: devel; +Cc: Greg Kroah-Hartman, linux-kernel

Ping ?

2012/11/30, Stefan Hajnoczi <stefanha@gmail.com>:
> Changes are fine.
>
> In the future, please split changes into individual patches.  For example:
> Patch 1 - Rename 'rv' to 'ret'
> Patch 2 - Replace decprecated simple_strtoul() with kstrtoint() in
> pcm_set_impulse_period()
> Patch 3 - Realign comment in line6_init_pcm() switch statement
>
> Keeping patches focussed on doing just one thing makes it easier to
> revert, bisect, and review them.
>
> Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>
>

Should I split patches as suggested by Stefan ?

Laurent.

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

end of thread, other threads:[~2012-12-12 12:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-30 10:57 staging: line6: pcm.c fix checkpatch issues Laurent Navet
2012-11-30 10:57 ` [PATCH] " Laurent Navet
2012-11-30 13:04   ` [Line6linux-devel] " Stefan Hajnoczi
2012-12-12 12:39     ` Laurent Navet

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).