Skip to content

Commit

Permalink
net/vmxnet3: signed/unsigned mismatch
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Andre Muezerie authored and shemminger committed Feb 10, 2025
1 parent 65cda7a commit d4d1e6c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/net/vmxnet3/vmxnet3_ethdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit d4d1e6c

Please sign in to comment.