提交 2230c3c8 编写于 作者: J Julia Lawall 提交者: Mauro Carvalho Chehab

V4L/DVB (10185): Use negated usb_endpoint_xfer_control, etc

This patch extends 13417982 by using
usb_endpoint_xfer_control, usb_endpoint_xfer_isoc, usb_endpoint_xfer_bulk,
and usb_endpoint_xfer_int in the negated case as well.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@ struct usb_endpoint_descriptor *epd; @@

- (usb_endpoint_type(epd) != \(USB_ENDPOINT_XFER_CONTROL\|0\))
+ !usb_endpoint_xfer_control(epd)

@@ struct usb_endpoint_descriptor *epd; @@

- (usb_endpoint_type(epd) != \(USB_ENDPOINT_XFER_ISOC\|1\))
+ !usb_endpoint_xfer_isoc(epd)

@@ struct usb_endpoint_descriptor *epd; @@

- (usb_endpoint_type(epd) != \(USB_ENDPOINT_XFER_BULK\|2\))
+ !usb_endpoint_xfer_bulk(epd)

@@ struct usb_endpoint_descriptor *epd; @@

- (usb_endpoint_type(epd) != \(USB_ENDPOINT_XFER_INT\|3\))
+ !usb_endpoint_xfer_int(epd)
// </smpl>
Signed-off-by: NJulia Lawall <julia@diku.dk>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 439b72b6
...@@ -1990,8 +1990,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -1990,8 +1990,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
int check_interface = 1; int check_interface = 1;
isoc_pipe = 1; isoc_pipe = 1;
endpoint = &interface->cur_altsetting->endpoint[1].desc; endpoint = &interface->cur_altsetting->endpoint[1].desc;
if (usb_endpoint_type(endpoint) != if (!usb_endpoint_xfer_isoc(endpoint))
USB_ENDPOINT_XFER_ISOC)
check_interface = 0; check_interface = 0;
if (usb_endpoint_dir_out(endpoint)) if (usb_endpoint_dir_out(endpoint))
......
...@@ -3779,7 +3779,7 @@ static int ibmcam_probe(struct usb_interface *intf, const struct usb_device_id * ...@@ -3779,7 +3779,7 @@ static int ibmcam_probe(struct usb_interface *intf, const struct usb_device_id *
err("Alternate settings have different endpoint addresses!"); err("Alternate settings have different endpoint addresses!");
return -ENODEV; return -ENODEV;
} }
if (usb_endpoint_type(endpoint) != USB_ENDPOINT_XFER_ISOC) { if (!usb_endpoint_xfer_isoc(endpoint)) {
err("Interface %d. has non-ISO endpoint!", ifnum); err("Interface %d. has non-ISO endpoint!", ifnum);
return -ENODEV; return -ENODEV;
} }
......
...@@ -823,7 +823,7 @@ static int konicawc_probe(struct usb_interface *intf, const struct usb_device_id ...@@ -823,7 +823,7 @@ static int konicawc_probe(struct usb_interface *intf, const struct usb_device_id
err("Alternate settings have different endpoint addresses!"); err("Alternate settings have different endpoint addresses!");
return -ENODEV; return -ENODEV;
} }
if (usb_endpoint_type(endpoint) != USB_ENDPOINT_XFER_ISOC) { if (!usb_endpoint_xfer_isoc(endpoint)) {
err("Interface %d. has non-ISO endpoint!", err("Interface %d. has non-ISO endpoint!",
interface->desc.bInterfaceNumber); interface->desc.bInterfaceNumber);
return -ENODEV; return -ENODEV;
......
...@@ -556,7 +556,7 @@ static int ultracam_probe(struct usb_interface *intf, const struct usb_device_id ...@@ -556,7 +556,7 @@ static int ultracam_probe(struct usb_interface *intf, const struct usb_device_id
err("Alternate settings have different endpoint addresses!"); err("Alternate settings have different endpoint addresses!");
return -ENODEV; return -ENODEV;
} }
if (usb_endpoint_type(endpoint) != USB_ENDPOINT_XFER_ISOC) { if (!usb_endpoint_xfer_isoc(endpoint)) {
err("Interface %d. has non-ISO endpoint!", err("Interface %d. has non-ISO endpoint!",
interface->desc.bInterfaceNumber); interface->desc.bInterfaceNumber);
return -ENODEV; return -ENODEV;
......
...@@ -1674,8 +1674,7 @@ static int __devinit usbvision_probe(struct usb_interface *intf, ...@@ -1674,8 +1674,7 @@ static int __devinit usbvision_probe(struct usb_interface *intf,
interface = &dev->actconfig->interface[ifnum]->altsetting[0]; interface = &dev->actconfig->interface[ifnum]->altsetting[0];
} }
endpoint = &interface->endpoint[1].desc; endpoint = &interface->endpoint[1].desc;
if (usb_endpoint_type(endpoint) != if (!usb_endpoint_xfer_isoc(endpoint)) {
USB_ENDPOINT_XFER_ISOC) {
err("%s: interface %d. has non-ISO endpoint!", err("%s: interface %d. has non-ISO endpoint!",
__func__, ifnum); __func__, ifnum);
err("%s: Endpoint attributes %d", err("%s: Endpoint attributes %d",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册