[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220513071608.49047-1-guozhengkui@vivo.com>
Date: Fri, 13 May 2022 15:16:06 +0800
From: Guo Zhengkui <guozhengkui@...o.com>
To: Ian Abbott <abbotti@....co.uk>,
H Hartley Sweeten <hsweeten@...ionengravers.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Guo Zhengkui <guozhengkui@...o.com>,
linux-kernel@...r.kernel.org (open list)
Cc: zhengkui_guo@...look.com
Subject: [PATCH] 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.
Signed-off-by: Guo Zhengkui <guozhengkui@...o.com>
---
drivers/comedi/drivers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/comedi/drivers.c b/drivers/comedi/drivers.c
index 8eb1f699a857..d4e2ed709bfc 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);
--
2.20.1
Powered by blists - more mailing lists