From: Guo Zhengkui Date: Fri, 13 May 2022 07:16:06 +0000 (+0800) Subject: drivers: comedi: replace ternary operator with min() X-Git-Tag: v6.1-rc5~1160^2~69 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=80ad54a63af3a3e2eb701fbf30242a922c4fac47;p=platform%2Fkernel%2Flinux-starfive.git drivers: comedi: replace ternary operator with min() Fix the following coccicheck warning: drivers/comedi/drivers.c:857:12-13: WARNING opportunity for min(). min() macro is defined in include/linux/minmax.h. It avoids multiple evaluations of the arguments when non-constant and performs strict type-checking. Reviewed-by: Ian Abbott Signed-off-by: Guo Zhengkui Link: https://lore.kernel.org/r/20220513071608.49047-1-guozhengkui@vivo.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/comedi/drivers.c b/drivers/comedi/drivers.c index 8eb1f69..d4e2ed7 100644 --- a/drivers/comedi/drivers.c +++ b/drivers/comedi/drivers.c @@ -854,7 +854,7 @@ int comedi_load_firmware(struct comedi_device *dev, release_firmware(fw); } - return ret < 0 ? ret : 0; + return min(ret, 0); } EXPORT_SYMBOL_GPL(comedi_load_firmware);