]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
usb: gadget: pch_udc: Replace cpu_to_le32() by lower_32_bits()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 23 Mar 2021 15:36:20 +0000 (17:36 +0200)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 24 May 2021 23:46:21 +0000 (17:46 -0600)
BugLink: https://bugs.launchpad.net/bugs/1929455
[ Upstream commit 91356fed6afd1c83bf0d3df1fc336d54e38f0458 ]

Either way ~0 will be in the correct byte order, hence
replace cpu_to_le32() by lower_32_bits(). Moreover,
it makes sparse happy, otherwise it complains:

.../pch_udc.c:1813:27: warning: incorrect type in assignment (different base types)
.../pch_udc.c:1813:27:    expected unsigned int [usertype] dataptr
.../pch_udc.c:1813:27:    got restricted __le32 [usertype]

Fixes: f646cf94520e ("USB device driver of Topcliff PCH")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210323153626.54908-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/usb/gadget/udc/pch_udc.c

index 931a09fdbf6d1330a6803da3a92e01a2c9c356a3..f6f8965c4f8c6d6baccf7cde278a45aa71e0cb48 100644 (file)
@@ -1765,7 +1765,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 = cpu_to_le32(DMA_ADDR_INVALID);
+       dma_desc->dataptr = lower_32_bits(DMA_ADDR_INVALID);
        req->td_data = dma_desc;
        req->td_data_last = dma_desc;
        req->chain_len = 1;