mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rslib: replace ternary operator with min()
@ 2022-10-25 15:15 wangkailong
  0 siblings, 0 replies; only message in thread
From: wangkailong @ 2022-10-25 15:15 UTC (permalink / raw)
  To: Jason, djwong, hca, gregkh, kuba; +Cc: linux-kernel

Fix the following coccicheck warning:

lib/reed_solomon/test_rslib.c:422: WARNING opportunity for min()

Signed-off-by: KaiLong Wang <wangkailong@jari.cn>
---
 lib/reed_solomon/test_rslib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/reed_solomon/test_rslib.c b/lib/reed_solomon/test_rslib.c
index 848e7eb5da92..f4a03ae43b86 100644
--- a/lib/reed_solomon/test_rslib.c
+++ b/lib/reed_solomon/test_rslib.c
@@ -419,7 +419,7 @@ static int exercise_rs_bc(struct rs_control *rs, struct wspace *ws,
 		if (eras < 0)
 			eras = 0;
 
-		cutoff = nroots <= len - errs ? nroots : len - errs;
+		cutoff = min(nroots, len - errs);
 		for (; eras <= cutoff; eras++)
 			test_bc(rs, len, errs, eras, trials, &stat, ws);
 	}
-- 
2.25.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-25 15:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-25 15:15 [PATCH] rslib: replace ternary operator with min() wangkailong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®