All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antonio Ospite <ao2@ao2.it>
To: linux-input@vger.kernel.org
Cc: Antonio Ospite <ao2@ao2.it>, Jiri Kosina <jkosina@suse.cz>,
	Lauri Kasanen <cand@gmx.com>,
	Frank Praznik <frank.praznik@oh.rr.com>
Subject: [PATCH 5/5] HID: sony: Coding style cleanups in sixaxis_set_operational_usb()
Date: Mon, 16 Feb 2015 18:12:24 +0100	[thread overview]
Message-ID: <1424106744-12872-6-git-send-email-ao2@ao2.it> (raw)
In-Reply-To: <1424106744-12872-1-git-send-email-ao2@ao2.it>

Don't mix declaration and allocation, remove some useless newlines
between calling a function and checking its return value.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
---
 drivers/hid/hid-sony.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 4a50e65..9e0987d 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -1131,17 +1131,17 @@ static void sony_input_configured(struct hid_device *hdev,
  */
 static int sixaxis_set_operational_usb(struct hid_device *hdev)
 {
-	int ret;
 	const int buf_size =
 		max(SIXAXIS_REPORT_0xF2_SIZE, SIXAXIS_REPORT_0xF5_SIZE);
-	__u8 *buf = kmalloc(buf_size, GFP_KERNEL);
+	__u8 *buf;
+	int ret;
 
+	buf = kmalloc(buf_size, GFP_KERNEL);
 	if (!buf)
 		return -ENOMEM;
 
 	ret = hid_hw_raw_request(hdev, 0xf2, buf, SIXAXIS_REPORT_0xF2_SIZE,
 				 HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
-
 	if (ret < 0) {
 		hid_err(hdev, "can't set operational mode: step 1\n");
 		goto out;
@@ -1153,14 +1153,12 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev)
 	 */
 	ret = hid_hw_raw_request(hdev, 0xf5, buf, SIXAXIS_REPORT_0xF5_SIZE,
 				 HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
-
 	if (ret < 0) {
 		hid_err(hdev, "can't set operational mode: step 2\n");
 		goto out;
 	}
 
 	ret = hid_hw_output_report(hdev, buf, 1);
-
 	if (ret < 0)
 		hid_err(hdev, "can't set operational mode: step 3\n");
 
-- 
2.1.4


  parent reply	other threads:[~2015-02-16 17:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-16 13:06 [PATCHv4] HID: sony: Enable Gasia third-party PS3 controllers Lauri Kasanen
2015-02-16 16:59 ` Antonio Ospite
2015-02-17 12:18   ` Jiri Kosina
2015-02-16 17:12 ` [PATCH 0/5] HID: sony: misc fixes and cleanups Antonio Ospite
2015-02-16 17:12   ` [PATCH 2/5] HID: sony: Use the minimum accepted size for feature report 0xf2 Antonio Ospite
2015-02-16 17:12   ` [PATCH 3/5] HID: sony: Don't use magic numbers in sixaxis_set_operational_usb() Antonio Ospite
2015-02-16 17:12   ` [PATCH 4/5] HID: sony: Use __u8 * for the buffer " Antonio Ospite
2015-02-16 17:12   ` Antonio Ospite [this message]
2015-02-16 21:48   ` [PATCH 0/5] HID: sony: misc fixes and cleanups Frank Praznik
2015-02-16 22:29     ` Antonio Ospite
2015-02-16 21:58   ` [PATCH 1/5] HID: sony: Fix a WARNING shown when rmmod-ing the driver Antonio Ospite
2015-02-17 18:03   ` [PATCH 0/5] HID: sony: misc fixes and cleanups Frank Praznik
2015-02-18 20:41   ` Jiri Kosina

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=1424106744-12872-6-git-send-email-ao2@ao2.it \
    --to=ao2@ao2.it \
    --cc=cand@gmx.com \
    --cc=frank.praznik@oh.rr.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@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.