提交 9b4632ef 编写于 作者: M Masahiro Yamada 提交者: Greg Kroah-Hartman

usb: mtu3: cleanup with list_first_entry_or_null()

The combo of list_empty() and list_first_entry() can be replaced with
list_first_entry_or_null().
Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 4642d34a
...@@ -356,12 +356,8 @@ static inline struct mtu3_ep *to_mtu3_ep(struct usb_ep *ep) ...@@ -356,12 +356,8 @@ static inline struct mtu3_ep *to_mtu3_ep(struct usb_ep *ep)
static inline struct mtu3_request *next_request(struct mtu3_ep *mep) static inline struct mtu3_request *next_request(struct mtu3_ep *mep)
{ {
struct list_head *queue = &mep->req_list; return list_first_entry_or_null(&mep->req_list, struct mtu3_request,
list);
if (list_empty(queue))
return NULL;
return list_first_entry(queue, struct mtu3_request, list);
} }
static inline void mtu3_writel(void __iomem *base, u32 offset, u32 data) static inline void mtu3_writel(void __iomem *base, u32 offset, u32 data)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册