]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
usb: udc: Convert use of __constant_cpu_to_leXX to cpu_to_leXX
authorVaishali Thakkar <vthakkar1994@gmail.com>
Wed, 10 Jun 2015 10:34:25 +0000 (16:04 +0530)
committerFelipe Balbi <balbi@ti.com>
Wed, 29 Jul 2015 14:59:18 +0000 (09:59 -0500)
In big endian cases, the macro cpu_to_le{16,32} unfolds to __swab{16,32}
which provides special case for constants. In little endian cases,
__constant_cpu_to_le{16,32} and cpu_to_le{16,32} expand directly to
the same expression. So, replace __constant_cpu_to_le{16,32} with
cpu_to_le{16,32} with the goal of getting rid of the definition of
__constant_cpu_to_le{16,32} completely.

The semantic patch that performs this transformation is as follows:

@@expression x;@@

(
- __constant_cpu_to_le16(x)
+ cpu_to_le16(x)
|
- __constant_cpu_to_le32(x)
+ cpu_to_le32(x)
)

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc/net2272.c
drivers/usb/gadget/udc/pch_udc.c

index 195baf3e1fcd4722c80e47f0789de17cf2ad0a88..c2ed5daebb752824ab69ee615c32ffad3c188cfa 100644 (file)
@@ -1826,9 +1826,9 @@ net2272_handle_stat0_irqs(struct net2272 *dev, u8 stat)
                                if (!e || u.r.wLength > 2)
                                        goto do_stall;
                                if (net2272_ep_read(e, EP_RSPSET) & (1 << ENDPOINT_HALT))
-                                       status = __constant_cpu_to_le16(1);
+                                       status = cpu_to_le16(1);
                                else
-                                       status = __constant_cpu_to_le16(0);
+                                       status = cpu_to_le16(0);
 
                                /* don't bother with a request object! */
                                net2272_ep_write(&dev->ep[0], EP_IRQENB, 0);
index 613547f078286f157bf8f1b499e3dfca55dc0953..dcf5defdb9e50abf05951614b5aecb43ac7a4495 100644 (file)
@@ -1793,7 +1793,7 @@ static struct usb_request *pch_udc_alloc_request(struct usb_ep *usbep,
        }
        /* prevent from using desc. - set HOST BUSY */
        dma_desc->status |= PCH_UDC_BS_HST_BSY;
-       dma_desc->dataptr = __constant_cpu_to_le32(DMA_ADDR_INVALID);
+       dma_desc->dataptr = cpu_to_le32(DMA_ADDR_INVALID);
        req->td_data = dma_desc;
        req->td_data_last = dma_desc;
        req->chain_len = 1;