From: Grigor Tovmasyan Date: Tue, 3 Apr 2018 11:22:25 +0000 (+0400) Subject: usb: dwc2: gadget: Fix coverity issue X-Git-Tag: v4.18-rc1~136^2~81^2 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=47265c067c0d129f3a0e94bc221293a780af9d78;p=linux.git usb: dwc2: gadget: Fix coverity issue When _param is unsigned and the minimum value of range is 0, it gives the following warning: COVERITY NO_EFFECT: This less-than-zero comparison of an unsigned value is never true. Converting ._param to int to avoid this warning. Signed-off-by: Grigor Tovmasyan Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c index a24ba13a2f15..af075d4da895 100644 --- a/drivers/usb/dwc2/params.c +++ b/drivers/usb/dwc2/params.c @@ -556,7 +556,7 @@ static void dwc2_check_param_tx_fifo_sizes(struct dwc2_hsotg *hsotg) } #define CHECK_RANGE(_param, _min, _max, _def) do { \ - if ((hsotg->params._param) < (_min) || \ + if ((int)(hsotg->params._param) < (_min) || \ (hsotg->params._param) > (_max)) { \ dev_warn(hsotg->dev, "%s: Invalid parameter %s=%d\n", \ __func__, #_param, hsotg->params._param); \