All of lore.kernel.org
 help / color / mirror / Atom feed
From: Telemaque Ndizihiwe <telendiz@eircom.net>
To: rddunlap@osdl.org, bhards@bigpond.net.au
Cc: torvalds@osdl.org, akpm@osdl.org, trivial@rustcorp.com.au,
	linux-kernel@vger.kernel.org
Subject: [PATCH] Remove unnecessary addition operations from usb/core/hub.c
Date: Sat, 19 Feb 2005 19:03:27 +0000	[thread overview]
Message-ID: <1108839807.7748.24.camel@localhost.localdomain> (raw)

This Patch removes unnecessary addition operations from
usb/core/hub.c in kernel 2.6.10.

	usb_disable_endpoint(udev, 0 + USB_DIR_IN);   //replaced by
	usb_disable_endpoint(udev, USB_DIR_IN);

	usb_disable_endpoint(udev, 0 + USB_DIR_OUT);  //replaced by	
	usb_disable_endpoint(udev, USB_DIR_OUT);


Signed-off-by: Telemaque Ndizihiwe <telendiz@eircom.net>


--- linux-2.6.10/drivers/usb/core/hub.c.orig	2005-02-19
12:26:28.682067480 +0000
+++ linux-2.6.10/drivers/usb/core/hub.c	2005-02-19 12:38:55.059600848
+0000
@@ -2044,8 +2044,8 @@ static int hub_set_address(struct usb_de
 		int m = udev->epmaxpacketin[0];
 
 		usb_set_device_state(udev, USB_STATE_ADDRESS);
-		usb_disable_endpoint(udev, 0 + USB_DIR_IN);
-		usb_disable_endpoint(udev, 0 + USB_DIR_OUT);
+		usb_disable_endpoint(udev, USB_DIR_IN);
+		usb_disable_endpoint(udev, USB_DIR_OUT);
 		udev->epmaxpacketin[0] = udev->epmaxpacketout[0] = m;
 	}
 	return retval;
@@ -2244,8 +2244,8 @@ hub_port_init (struct usb_device *hdev, 
 	i = udev->descriptor.bMaxPacketSize0;
 	if (udev->epmaxpacketin[0] != i) {
 		dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);
-		usb_disable_endpoint(udev, 0 + USB_DIR_IN);
-		usb_disable_endpoint(udev, 0 + USB_DIR_OUT);
+		usb_disable_endpoint(udev, USB_DIR_IN);
+		usb_disable_endpoint(udev, USB_DIR_OUT);
 		udev->epmaxpacketin[0] = udev->epmaxpacketout[0] = i;
 	}
   
@@ -2508,8 +2508,8 @@ static void hub_port_connect_change(stru
 
 loop:
 		hub_port_disable(hdev, port);
-		usb_disable_endpoint(udev, 0 + USB_DIR_IN);
-		usb_disable_endpoint(udev, 0 + USB_DIR_OUT);
+		usb_disable_endpoint(udev, USB_DIR_IN);
+		usb_disable_endpoint(udev, USB_DIR_OUT);
 		release_address(udev);
 		usb_put_dev(udev);
 		if (status == -ENOTCONN)
@@ -2893,8 +2893,8 @@ int usb_reset_device(struct usb_device *
 
 		/* ep0 maxpacket size may change; let the HCD know about it.
 		 * Other endpoints will be handled by re-enumeration. */
-		usb_disable_endpoint(udev, 0 + USB_DIR_IN);
-		usb_disable_endpoint(udev, 0 + USB_DIR_OUT);
+		usb_disable_endpoint(udev, USB_DIR_IN);
+		usb_disable_endpoint(udev, USB_DIR_OUT);
 		ret = hub_port_init(parent, udev, port, i);
 		if (ret >= 0)
 			break;



             reply	other threads:[~2005-02-19 19:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-19 19:03 Telemaque Ndizihiwe [this message]
2005-02-19 22:40 ` [PATCH] Remove unnecessary addition operations from usb/core/hub.c 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=1108839807.7748.24.camel@localhost.localdomain \
    --to=telendiz@eircom.net \
    --cc=akpm@osdl.org \
    --cc=bhards@bigpond.net.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rddunlap@osdl.org \
    --cc=torvalds@osdl.org \
    --cc=trivial@rustcorp.com.au \
    /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.