All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Schroer <sulamiification@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Joe Perches <joe@perches.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/hid/wacom: fixed coding style issues
Date: Wed, 22 Jan 2014 15:48:24 +0100	[thread overview]
Message-ID: <20140122144824.GA15985@hal9k.fritz.box> (raw)
In-Reply-To: <20140122064045.GA4143@core.coreip.homeip.net>

On Tue, Jan 21, 2014 at 10:40:45PM -0800, Dmitry Torokhov wrote:
> I think this should be
>
> 	error = kstrtoint(buf, 10, &new_speed);
> 	if (error)
> 		return error;
>

I just lost my SSD/branch, so here is a fresh patch for mainline:

Fixed some coding style issues, removed unessecary spaces, added
linebreaks, converted an occurence of sscanf to kstrtoint.

Signed-off-by: Robin Schroer <sulamiification@gmail.com>
---
 drivers/hid/hid-wacom.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index 60c75dc..c7f9d1c 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -77,8 +77,8 @@ static void wacom_scramble(__u8 *image)
 	__u16 mask;
 	__u16 s1;
 	__u16 s2;
-	__u16 r1 ;
-	__u16 r2 ;
+	__u16 r1;
+	__u16 r2;
 	__u16 r;
 	__u8 buf[256];
 	int i, w, x, y, z;
@@ -336,7 +336,8 @@ static void wacom_set_features(struct hid_device *hdev, u8 speed)

 	switch (hdev->product) {
 	case USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH:
-		rep_data[0] = 0x03 ; rep_data[1] = 0x00;
+		rep_data[0] = 0x03;
+		rep_data[1] = 0x00;
 		limit = 3;
 		do {
 			ret = hdev->hid_output_raw_report(hdev, rep_data, 2,
@@ -403,9 +404,11 @@ static ssize_t wacom_store_speed(struct device *dev,
 {
 	struct hid_device *hdev = container_of(dev, struct hid_device, dev);
 	int new_speed;
+	int error;

-	if (sscanf(buf, "%1d", &new_speed ) != 1)
-		return -EINVAL;
+	error = kstrtoint(buf, 10, &new_speed);
+	if (error)
+		return error;

 	if (new_speed == 0 || new_speed == 1) {
 		wacom_set_features(hdev, new_speed);
--
1.8.4.2

--
Robin

      reply	other threads:[~2014-01-22 14:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-21 19:51 [PATCH] drivers/hid/wacom: fixed coding style issues Robin Schroer
2014-01-21 20:06 ` Dmitry Torokhov
2014-01-21 20:29   ` Rob Schroer
2014-01-21 21:18     ` Dmitry Torokhov
2014-01-21 21:25       ` Joe Perches
2014-01-21 22:42         ` Rob Schroer
2014-01-22  6:40           ` Dmitry Torokhov
2014-01-22 14:48             ` Rob Schroer [this message]

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=20140122144824.GA15985@hal9k.fritz.box \
    --to=sulamiification@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.