[PATCH] usb: ch9.h: bugfix: usb_endpoint_maxp() is wrapped with __KERNEL__

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The usb/ch9.h will be installed to /usr/include/linux,
and le16_to_cpu() is only defined for kernel code.
Without this patch, user space compile will be broken.
Special thanks to Stefan Becker

Reported-by: Stefan Becker <chemobejk@xxxxxxxxx>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
---
- Greg, Felipe

3.1/3.2 kernel seems need this patch for stable

 include/linux/usb/ch9.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index d5da6c6..103df3e 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -581,6 +581,7 @@ static inline int usb_endpoint_is_isoc_out(
 	return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd);
 }
 
+#ifdef __KERNEL__
 /**
  * usb_endpoint_maxp - get endpoint's max packet size
  * @epd: endpoint to be checked
@@ -591,6 +592,7 @@ static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd)
 {
 	return le16_to_cpu(epd->wMaxPacketSize);
 }
+#endif
 
 /*-------------------------------------------------------------------------*/
 
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux