From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
stable@dpdk.org, Hemant Agrawal <hemant.agrawal@nxp.com>,
Sachin Saxena <sachin.saxena@nxp.com>,
Jun Yang <jun.yang@nxp.com>
Subject: [PATCH 2/7] bus/fslmc: fix signed comparison in buffer acquire
Date: Fri, 4 Sep 2026 12:12:37 -0700 [thread overview]
Message-ID: <20260904191652.2399074-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20260904191652.2399074-1-stephen@networkplumber.org>
The acquired buffer count is masked with BMAN_VALID_RSLT_NUM_MASK so
it is always in the range 0..7, but it was held in an int and then
compared against the unsigned num_buffers parameter, giving a
-Wsign-compare warning in both acquire paths.
Make the count unsigned to match num_buffers. The error paths return
negative errno values directly and are unaffected.
Fixes: a116979a03c6 ("bus/fslmc: improve BMAN buffer acquire")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/bus/fslmc/qbman/qbman_portal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c
index c93bec5dd3..7b666d4ef9 100644
--- a/drivers/bus/fslmc/qbman/qbman_portal.c
+++ b/drivers/bus/fslmc/qbman/qbman_portal.c
@@ -2680,7 +2680,7 @@ static int qbman_swp_acquire_direct(struct qbman_swp *s, uint16_t bpid,
{
struct qbman_acquire_desc *p;
struct qbman_acquire_rslt *r;
- int num;
+ unsigned int num;
if (!num_buffers || (num_buffers > BMAN_VALID_RSLT_NUM_MASK))
return -EINVAL;
@@ -2727,7 +2727,7 @@ static int qbman_swp_acquire_cinh_direct(struct qbman_swp *s, uint16_t bpid,
{
struct qbman_acquire_desc *p;
struct qbman_acquire_rslt *r;
- int num;
+ unsigned int num;
if (!num_buffers || (num_buffers > BMAN_VALID_RSLT_NUM_MASK))
return -EINVAL;
--
2.53.0
next prev parent reply other threads:[~2026-09-04 19:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 19:12 [PATCH 0/7] fix XXX_DEBUG warnings Stephen Hemminger
2026-09-04 19:12 ` [PATCH 1/7] bus/fslmc: fix build of qbman debug code Stephen Hemminger
2026-09-10 16:51 ` hemant.agrawal
2026-09-04 19:12 ` Stephen Hemminger [this message]
2026-09-11 5:00 ` [PATCH 2/7] bus/fslmc: fix signed comparison in buffer acquire Hemant Agrawal
2026-09-04 19:12 ` [PATCH 3/7] crypto/caam_jr: fix descriptor dump build Stephen Hemminger
2026-09-11 5:01 ` Hemant Agrawal
2026-09-04 19:12 ` [PATCH 4/7] crypto/ipsec_mb: fix missing header for debug build Stephen Hemminger
2026-09-04 19:12 ` [PATCH 5/7] power/amd_uncore: fix debug log build Stephen Hemminger
2026-09-04 19:12 ` [PATCH 6/7] net/rnp: fix register debug log format Stephen Hemminger
2026-09-04 19:12 ` [PATCH 7/7] net/vmxnet3: remove unused queue dump functions Stephen Hemminger
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=20260904191652.2399074-3-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=hemant.agrawal@nxp.com \
--cc=jun.yang@nxp.com \
--cc=sachin.saxena@nxp.com \
--cc=stable@dpdk.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.