mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: Use put_unaligned_le16() from asm/unaligned.h
@ 2026-04-13 19:51 Sascha Hauer
  2026-04-14  8:38 ` Ahmad Fatoum
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2026-04-13 19:51 UTC (permalink / raw)
  To: Barebox List

usbstring.c has its own put_unaligned_le16() function instead of using
the existing one from asm/unaligned.h. This was never a problem, but
since 87d3ae4bee ("filetype: fix unaligned access for x86_linux_bootimage")
the conflicting definition from asm/unaligned.h leaks in which results
in a failed build. Drop the duplicate function and explicitly include
the correct definition.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/gadget/usbstring.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/usb/gadget/usbstring.c b/drivers/usb/gadget/usbstring.c
index 58eb28ad1a..209a3d01d8 100644
--- a/drivers/usb/gadget/usbstring.c
+++ b/drivers/usb/gadget/usbstring.c
@@ -8,12 +8,7 @@
 
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
-
-static inline void put_unaligned_le16(u16 val, u8 *p)
-{
-	*p++ = val;
-	*p++ = val >> 8;
-}
+#include <asm/unaligned.h>
 
 static int utf8_to_utf16le(const char *s, __le16 *cp, unsigned len)
 {
-- 
2.47.3




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

* Re: [PATCH] usb: gadget: Use put_unaligned_le16() from asm/unaligned.h
  2026-04-13 19:51 [PATCH] usb: gadget: Use put_unaligned_le16() from asm/unaligned.h Sascha Hauer
@ 2026-04-14  8:38 ` Ahmad Fatoum
  0 siblings, 0 replies; 2+ messages in thread
From: Ahmad Fatoum @ 2026-04-14  8:38 UTC (permalink / raw)
  To: Sascha Hauer, Barebox List



On 4/13/26 9:51 PM, Sascha Hauer wrote:
> usbstring.c has its own put_unaligned_le16() function instead of using
> the existing one from asm/unaligned.h. This was never a problem, but
> since 87d3ae4bee ("filetype: fix unaligned access for x86_linux_bootimage")
> the conflicting definition from asm/unaligned.h leaks in which results
> in a failed build. Drop the duplicate function and explicitly include
> the correct definition.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

> ---
>  drivers/usb/gadget/usbstring.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/usb/gadget/usbstring.c b/drivers/usb/gadget/usbstring.c
> index 58eb28ad1a..209a3d01d8 100644
> --- a/drivers/usb/gadget/usbstring.c
> +++ b/drivers/usb/gadget/usbstring.c
> @@ -8,12 +8,7 @@
>  
>  #include <linux/usb/ch9.h>
>  #include <linux/usb/gadget.h>
> -
> -static inline void put_unaligned_le16(u16 val, u8 *p)
> -{
> -	*p++ = val;
> -	*p++ = val >> 8;
> -}
> +#include <asm/unaligned.h>
>  
>  static int utf8_to_utf16le(const char *s, __le16 *cp, unsigned len)
>  {

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




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

end of thread, other threads:[~2026-04-14  8:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-13 19:51 [PATCH] usb: gadget: Use put_unaligned_le16() from asm/unaligned.h Sascha Hauer
2026-04-14  8:38 ` Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox