mirror of
https://github.com/torvalds/linux.git
synced 2024-12-12 14:12:51 +00:00
usb: dwc3: gadget: simplify next_request() return check
In dwc3_cleanup_done_reqs() we expect that all iterations of our while (1) loop will find a valid struct dwc3_request *. In case we don't, we're dumping a WARN_ON_ONCE() splat so that people report the failure. This patch is a simple cleanup converting: if (!req) { WARN_ON_ONCE(1); return 1; } to: if (WARN_ON_ONCE(!req)) return 1; which is a little easier to read. Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
acc38c4970
commit
ac7bdcc1b3
@ -1885,10 +1885,9 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep,
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
req = next_request(&dep->req_queued);
|
req = next_request(&dep->req_queued);
|
||||||
if (!req) {
|
if (WARN_ON_ONCE(!req))
|
||||||
WARN_ON_ONCE(1);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
i = 0;
|
i = 0;
|
||||||
do {
|
do {
|
||||||
slot = req->start_slot + i;
|
slot = req->start_slot + i;
|
||||||
|
Loading…
Reference in New Issue
Block a user