Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b4632ef authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Greg Kroah-Hartman
Browse files

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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4642d34a
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -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)