linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1 linux-next] cdc-acm: use swap() in acm_probe()
@ 2015-05-18 17:59 Fabian Frederick
  2015-05-19  8:00 ` Oliver Neukum
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2015-05-18 17:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Fabian Frederick, Oliver Neukum, Greg Kroah-Hartman, linux-usb

Use kernel.h macro definition.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/usb/class/cdc-acm.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 5c8f581..8d045be 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1267,12 +1267,9 @@ skip_normal_probe:
 						!= CDC_DATA_INTERFACE_TYPE) {
 		if (control_interface->cur_altsetting->desc.bInterfaceClass
 						== CDC_DATA_INTERFACE_TYPE) {
-			struct usb_interface *t;
 			dev_dbg(&intf->dev,
 				"Your device has switched interfaces.\n");
-			t = control_interface;
-			control_interface = data_interface;
-			data_interface = t;
+			swap(control_interface, data_interface);
 		} else {
 			return -EINVAL;
 		}
@@ -1301,12 +1298,9 @@ skip_normal_probe:
 	/* workaround for switched endpoints */
 	if (!usb_endpoint_dir_in(epread)) {
 		/* descriptors are swapped */
-		struct usb_endpoint_descriptor *t;
 		dev_dbg(&intf->dev,
 			"The data interface has switched endpoints\n");
-		t = epread;
-		epread = epwrite;
-		epwrite = t;
+		swap(epread, epwrite);
 	}
 made_compressed_probe:
 	dev_dbg(&intf->dev, "interfaces are valid\n");
-- 
2.4.0


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

* Re: [PATCH 1/1 linux-next] cdc-acm: use swap() in acm_probe()
  2015-05-18 17:59 [PATCH 1/1 linux-next] cdc-acm: use swap() in acm_probe() Fabian Frederick
@ 2015-05-19  8:00 ` Oliver Neukum
  0 siblings, 0 replies; 2+ messages in thread
From: Oliver Neukum @ 2015-05-19  8:00 UTC (permalink / raw)
  To: Fabian Frederick; +Cc: linux-kernel, Greg Kroah-Hartman, linux-usb

On Mon, 2015-05-18 at 19:59 +0200, Fabian Frederick wrote:
> Use kernel.h macro definition.
> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Acked-by: Oliver Neukum <oneukum@suse.de>



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

end of thread, other threads:[~2015-05-19  8:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-18 17:59 [PATCH 1/1 linux-next] cdc-acm: use swap() in acm_probe() Fabian Frederick
2015-05-19  8:00 ` Oliver Neukum

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