From: Andre Muezerie <andremue@linux.microsoft.com>
To: Jochen Behrens <jochen.behrens@broadcom.com>
Cc: dev@dpdk.org, Andre Muezerie <andremue@linux.microsoft.com>
Subject: [PATCH] drivers/net: signed/unsigned mismatch
Date: Mon, 10 Feb 2025 13:25:25 -0800 [thread overview]
Message-ID: <1739222725-30747-1-git-send-email-andremue@linux.microsoft.com> (raw)
This patch avoids warning C4018: '>=': signed/unsigned mismatch
The fix is to use U suffix to indicate the numbers are unsigned before
the comparisons are made.
Also renamed variables to make them compliant to DPDK standards and
avoid checkpatch warnings.
Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
---
drivers/net/vmxnet3/vmxnet3_ethdev.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h
index e9ded6663d..fd150d12c5 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.h
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h
@@ -183,17 +183,17 @@ vmxnet3_read_addr(volatile void *addr)
VMXNET3_PCI_REG_WRITE(VMXNET3_PCI_BAR1_REG_ADDR((hw), (reg)), (value))
static inline uint8_t
-vmxnet3_get_ring_idx(struct vmxnet3_hw *hw, uint32 rqID)
+vmxnet3_get_ring_idx(struct vmxnet3_hw *hw, uint32_t rq_id)
{
- return (rqID >= hw->num_rx_queues &&
- rqID < 2 * hw->num_rx_queues) ? 1 : 0;
+ return (rq_id >= hw->num_rx_queues &&
+ rq_id < 2U * hw->num_rx_queues) ? 1 : 0;
}
static inline bool
-vmxnet3_rx_data_ring(struct vmxnet3_hw *hw, uint32 rqID)
+vmxnet3_rx_data_ring(struct vmxnet3_hw *hw, uint32_t rq_id)
{
- return (rqID >= 2 * hw->num_rx_queues &&
- rqID < 3 * hw->num_rx_queues);
+ return (rq_id >= 2U * hw->num_rx_queues &&
+ rq_id < 3U * hw->num_rx_queues);
}
/*
--
2.47.2.vfs.0.1
reply other threads:[~2025-02-10 21:25 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=1739222725-30747-1-git-send-email-andremue@linux.microsoft.com \
--to=andremue@linux.microsoft.com \
--cc=dev@dpdk.org \
--cc=jochen.behrens@broadcom.com \
/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;
as well as URLs for NNTP newsgroup(s).