[PATCH] usb: class: usblp: replace conditional statement with min()

From: Salah Triki
Date: Mon Aug 02 2021 - 20:28:13 EST


Replace conditional statement with min() in order to make code cleaner. Issue
found by coccinelle.

Signed-off-by: Salah Triki <salah.triki@xxxxxxxxx>
---
drivers/usb/class/usblp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index f27b4aecff3d..fd779a989526 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -264,7 +264,7 @@ static int usblp_ctrl_msg(struct usblp *usblp, int request, int type, int dir, i
dev_dbg(&usblp->intf->dev,
"usblp_control_msg: rq: 0x%02x dir: %d recip: %d value: %d idx: %d len: %#x result: %d\n",
request, !!dir, recip, value, index, len, retval);
- return retval < 0 ? retval : 0;
+ return min(retval, 0);
}

#define usblp_read_status(usblp, status)\
--
2.25.1