From: Bin Liu Date: Mon, 21 May 2018 13:42:22 +0000 (-0500) Subject: usb: musb: gadget: fix to_musb_ep() to not return NULL X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ddf12f04dc5b284133662f81a9c4c46a72d3c6ba;p=linux.git usb: musb: gadget: fix to_musb_ep() to not return NULL UDC core ensures the usb_ep parameter passed in is not NULL, so checking if (ep != NULL) is pointless. Convert to_musb_ep() to a simple macro to not directly return NULL to avoid warnings from code static analysis tools. Signed-off-by: Bin Liu Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/musb/musb_gadget.h b/drivers/usb/musb/musb_gadget.h index 06d60848337fb..d02663660813e 100644 --- a/drivers/usb/musb/musb_gadget.h +++ b/drivers/usb/musb/musb_gadget.h @@ -96,10 +96,7 @@ struct musb_ep { u8 hb_mult; }; -static inline struct musb_ep *to_musb_ep(struct usb_ep *ep) -{ - return ep ? container_of(ep, struct musb_ep, end_point) : NULL; -} +#define to_musb_ep(ep) container_of((ep), struct musb_ep, end_point) static inline struct musb_request *next_request(struct musb_ep *ep) {