linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/7] usb: gadget: pch_udc: Replace cpu_to_le32() by lower_32_bits()
@ 2021-03-23 15:36 Andy Shevchenko
  2021-03-23 15:36 ` [PATCH v2 2/7] usb: gadget: pch_udc: Check if driver is present before calling ->setup() Andy Shevchenko
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Andy Shevchenko @ 2021-03-23 15:36 UTC (permalink / raw)
  To: Andy Shevchenko, linux-usb, linux-kernel
  Cc: Felipe Balbi, Greg Kroah-Hartman, Linus Walleij

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>
---
v2: fixed 64-bit build (Greg)
 drivers/usb/gadget/udc/pch_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c
index a3c1fc924268..c517186384bc 100644
--- a/drivers/usb/gadget/udc/pch_udc.c
+++ b/drivers/usb/gadget/udc/pch_udc.c
@@ -1756,7 +1756,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;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-03-25  9:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23 15:36 [PATCH v2 1/7] usb: gadget: pch_udc: Replace cpu_to_le32() by lower_32_bits() Andy Shevchenko
2021-03-23 15:36 ` [PATCH v2 2/7] usb: gadget: pch_udc: Check if driver is present before calling ->setup() Andy Shevchenko
2021-03-23 15:36 ` [PATCH v2 3/7] usb: gadget: pch_udc: Check for DMA mapping error Andy Shevchenko
2021-03-23 15:36 ` [PATCH v2 4/7] usb: gadget: pch_udc: Move pch_udc_init() to satisfy kernel doc Andy Shevchenko
2021-03-23 15:36 ` [PATCH v2 5/7] usb: gadget: pch_udc: Revert d3cb25a12138 completely Andy Shevchenko
2021-03-23 15:36 ` [PATCH v2 6/7] usb: gadget: pch_udc: Initialize device pointer before use Andy Shevchenko
2021-03-25  9:23   ` Linus Walleij
2021-03-23 15:36 ` [PATCH v2 7/7] usb: gadget: pch_udc: Provide a GPIO line used on Intel Minnowboard (v1) Andy Shevchenko
2021-03-25  8:18   ` Linus Walleij
2021-03-25  9:20 ` [PATCH v2 1/7] usb: gadget: pch_udc: Replace cpu_to_le32() by lower_32_bits() Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).