mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: wangkailong@jari.cn
To: Jason@zx2c4.com, djwong@kernel.org, hca@linux.ibm.com,
	gregkh@linuxfoundation.org, kuba@kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] rslib: replace ternary operator with min()
Date: Tue, 25 Oct 2022 23:15:01 +0800 (GMT+08:00)	[thread overview]
Message-ID: <4b3795b5.6.1840fb613ac.Coremail.wangkailong@jari.cn> (raw)

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

                 reply	other threads:[~2022-10-25 15:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4b3795b5.6.1840fb613ac.Coremail.wangkailong@jari.cn \
    --to=wangkailong@jari.cn \
    --cc=Jason@zx2c4.com \
    --cc=djwong@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hca@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®