[PATCH v9 04/28] net/rnp: support mailbox basic operate

Stephen Hemminger stephen at networkplumber.org
Tue Feb 11 16:31:10 CET 2025


On Tue, 11 Feb 2025 16:49:54 +0800
Wenbo Cao <caowenbo at mucse.com> wrote:

> +static inline u32
> +rnp_reg_read32(void *base, size_t offset)
> +{
> +	unsigned int v = rte_read32(((u8 *)base + offset));
> +
> +	RNP_PMD_REG_LOG(DEBUG, "offset=0x%08lx val=0x%04x",
> +			(unsigned long)offset, v);
> +	return v;
> +}

Why not use uint32_t here?
Why not use const?
Why the extra parens?

static inline u32
rnp_reg_read32(const void *base, size_t offset)
{
	u32 v = rte_read32((const u8 *)base + offset);

	RNP_PMD_REG_LOG(DEBUG, "offset=%p val=%#" PRIx32, offset, v);
}


More information about the dev mailing list