linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum.org>
To: jikos@suse.cz, linux-input@vger.kernel.org,
	linux-usb@vger.kernel.org, honza@jikos.cz
Subject: [patch]convert away from urb->status in xpad driver
Date: Thu, 3 Apr 2008 13:25:59 +0200	[thread overview]
Message-ID: <200804031326.00717.oliver@neukum.org> (raw)

USB is moving to transfering status as a parameter. To ease the transition
urb->status is to be touched only once in a function. The xpad driver has
been overlooked.

Signed-off-by: Oliver Neukum <oneukum@suse.de>

---

--- linux-2.6.25-rc7-vanilla/drivers/input/joystick/xpad.c	2008-03-31 15:20:58.000000000 +0200
+++ linux-2.6.25-rc7-work/drivers/input/joystick/xpad.c	2008-04-03 13:05:26.000000000 +0200
@@ -339,9 +339,11 @@ static void xpad360_process_packet(struc
 static void xpad_irq_in(struct urb *urb)
 {
 	struct usb_xpad *xpad = urb->context;
-	int retval;
+	int retval, status;
 
-	switch (urb->status) {
+	status = urb->status;
+
+	switch (status) {
 	case 0:
 		/* success */
 		break;
@@ -350,11 +352,11 @@ static void xpad_irq_in(struct urb *urb)
 	case -ESHUTDOWN:
 		/* this urb is terminated, clean up */
 		dbg("%s - urb shutting down with status: %d",
-			__FUNCTION__, urb->status);
+			__FUNCTION__, status);
 		return;
 	default:
 		dbg("%s - nonzero urb status received: %d",
-			__FUNCTION__, urb->status);
+			__FUNCTION__, status);
 		goto exit;
 	}
 
@@ -373,9 +375,11 @@ exit:
 #if defined(CONFIG_JOYSTICK_XPAD_FF) || defined(CONFIG_JOYSTICK_XPAD_LEDS)
 static void xpad_irq_out(struct urb *urb)
 {
-	int retval;
+	int retval, status;
+
+	status = urb->status;
 
-	switch (urb->status) {
+	switch (status) {
 		case 0:
 		/* success */
 		break;
@@ -384,11 +388,11 @@ static void xpad_irq_out(struct urb *urb
 		case -ESHUTDOWN:
 			/* this urb is terminated, clean up */
 			dbg("%s - urb shutting down with status: %d",
-				__FUNCTION__, urb->status);
+				__FUNCTION__, status);
 			return;
 		default:
 			dbg("%s - nonzero urb status received: %d",
-				__FUNCTION__, urb->status);
+				__FUNCTION__, status);
 			goto exit;
 	}
 

             reply	other threads:[~2008-04-03 11:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-03 11:25 Oliver Neukum [this message]
     [not found] ` <200804031326.00717.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2008-04-03 15:49   ` [patch]convert away from urb->status in xpad driver Jiri Kosina
2008-04-03 19:41     ` Dmitry Torokhov
     [not found]       ` <20080403153901.ZZRA012-NG0XCrj25/nJrYCpivWRnl5pS2h4L8biXqFh9Ls21Oc@public.gmane.org>
2008-04-03 20:26         ` Greg KH

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=200804031326.00717.oliver@neukum.org \
    --to=oliver@neukum.org \
    --cc=honza@jikos.cz \
    --cc=jikos@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-usb@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 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).