Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] rc-core: use USB API functions rather than constants

This patch introduces the use of !usb_endpoint_dir_in(epd) and
!usb_endpoint_xfer_int(epd).

The Coccinelle semantic patch that makes these changes is as follows:

- ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) !=
- \(USB_DIR_IN\|0x80\))
+ !usb_endpoint_dir_in(epd)

@@ struct usb_endpoint_descriptor *epd; @@

- ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) !=
- \(USB_ENDPOINT_XFER_INT\|3\))
+ !usb_endpoint_xfer_int(epd)

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Himangi Saraogi and committed by
Mauro Carvalho Chehab
5611588b 9408d8f0

+2 -4
+2 -4
drivers/media/rc/streamzap.c
··· 362 362 } 363 363 364 364 sz->endpoint = &(iface_host->endpoint[0].desc); 365 - if ((sz->endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) 366 - != USB_DIR_IN) { 365 + if (!usb_endpoint_dir_in(sz->endpoint)) { 367 366 dev_err(&intf->dev, "%s: endpoint doesn't match input device " 368 367 "02%02x\n", __func__, sz->endpoint->bEndpointAddress); 369 368 retval = -ENODEV; 370 369 goto free_sz; 371 370 } 372 371 373 - if ((sz->endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) 374 - != USB_ENDPOINT_XFER_INT) { 372 + if (!usb_endpoint_xfer_int(sz->endpoint)) { 375 373 dev_err(&intf->dev, "%s: endpoint attributes don't match xfer " 376 374 "02%02x\n", __func__, sz->endpoint->bmAttributes); 377 375 retval = -ENODEV;