diff options
author | Bin Liu <b-liu@ti.com> | 2018-05-21 08:42:21 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-22 12:03:25 +0200 |
commit | 8dca51071849077e83ec85b7e5d46c84cee227d9 (patch) | |
tree | 34946d2a027672ca26131a06f9801927718e941c /drivers/usb/musb | |
parent | 49484abd93ab259d5acb1ebf77d3041fe06abbdd (diff) | |
download | linux-stable-8dca51071849077e83ec85b7e5d46c84cee227d9.tar.gz linux-stable-8dca51071849077e83ec85b7e5d46c84cee227d9.tar.bz2 linux-stable-8dca51071849077e83ec85b7e5d46c84cee227d9.zip |
usb: musb: gadget: fix to_musb_request() to not return NULL
The gadget function drivers should ensure the usb_request parameter
passed in is not NULL. UDC core doesn't check if it is NULL, so MUSB
driver shouldn't have to check it either.
Convert to_musb_request() 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r-- | drivers/usb/musb/musb_gadget.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/usb/musb/musb_gadget.h b/drivers/usb/musb/musb_gadget.h index 9c34aca06db6..06d60848337f 100644 --- a/drivers/usb/musb/musb_gadget.h +++ b/drivers/usb/musb/musb_gadget.h @@ -60,10 +60,7 @@ struct musb_request { enum buffer_map_state map_state; }; -static inline struct musb_request *to_musb_request(struct usb_request *req) -{ - return req ? container_of(req, struct musb_request, request) : NULL; -} +#define to_musb_request(r) container_of((r), struct musb_request, request) extern struct usb_request * musb_alloc_request(struct usb_ep *ep, gfp_t gfp_flags); |