From: Masahiro Yamada Date: Sat, 20 May 2017 17:05:31 +0000 (+0900) Subject: usb: mtu3: cleanup with list_first_entry_or_null() X-Git-Tag: v4.13-rc1~185^2~74 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b4632ef3ff2097495e3724e7c4c1a307cbcfce4;p=platform%2Fkernel%2Flinux-exynos.git 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: Masahiro Yamada Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/mtu3/mtu3.h b/drivers/usb/mtu3/mtu3.h index aa6fd6a..7b6dc23 100644 --- a/drivers/usb/mtu3/mtu3.h +++ b/drivers/usb/mtu3/mtu3.h @@ -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) { - struct list_head *queue = &mep->req_list; - - if (list_empty(queue)) - return NULL; - - return list_first_entry(queue, struct mtu3_request, list); + return list_first_entry_or_null(&mep->req_list, struct mtu3_request, + list); } static inline void mtu3_writel(void __iomem *base, u32 offset, u32 data)