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: [email protected]
Signed-off-by: Stephen Hemminger <[email protected]>
---
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