cdc-acm: use swap() in acm_probe()
Subsystems (2)
PATCH 1/1 cdc-acm: use swap() in acm_probe()
Use kernel.h macro definition.
Signed-off-by Fabian Frederick <[email protected]>
--- drivers/usb/class/cdc-acm.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/usb/class/cdc-acm.c +2 -8
@@ -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" );
Signature · 1 line
2.4.0
Quoted 3 lines · Fabian Frederick
Use
kernel.hmacro definition.Signed-off-by Fabian Frederick <[email protected]>
Acked-by Oliver Neukum <[email protected]>