summaryrefslogtreecommitdiffstats
path: root/drivers/usb/mtu3
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-05-21 02:05:31 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-25 14:30:13 +0200
commit9b4632ef3ff2097495e3724e7c4c1a307cbcfce4 (patch)
tree70871f32f8a0f06c918b5fdf33938138c81703e7 /drivers/usb/mtu3
parent4642d34a439f80e16af0d56ed6258a33abae257a (diff)
downloadtalos-obmc-linux-9b4632ef3ff2097495e3724e7c4c1a307cbcfce4.tar.gz
talos-obmc-linux-9b4632ef3ff2097495e3724e7c4c1a307cbcfce4.zip
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 <yamada.masahiro@socionext.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/mtu3')
-rw-r--r--drivers/usb/mtu3/mtu3.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/usb/mtu3/mtu3.h b/drivers/usb/mtu3/mtu3.h
index aa6fd6a51221..7b6dc23d77e9 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)
OpenPOWER on IntegriCloud