All of lore.kernel.org
 help / color / mirror / Atom feed
* [v2,2/3] usb: musb: gadget: fix to_musb_ep() to not return NULL
@ 2018-04-26 12:47 Bin Liu
  0 siblings, 0 replies; only message in thread
From: Bin Liu @ 2018-04-26 12:47 UTC (permalink / raw)
  To: linux-usb; +Cc: Sekhar Nori, Bin Liu

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 <b-liu@ti.com>
---
v2: revised the parentheses.

 drivers/usb/musb/musb_gadget.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/usb/musb/musb_gadget.h b/drivers/usb/musb/musb_gadget.h
index 06d60848337f..d02663660813 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)
 {

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-26 12:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-26 12:47 [v2,2/3] usb: musb: gadget: fix to_musb_ep() to not return NULL Bin Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.