Re: Re: [PATCH net-next v11 2/5] hinic3: Add ethtool statistic ops

From: Fan Gong

Date: Wed Jul 22 2026 - 21:38:23 EST


> > +
> > +static u64 get_val_of_ptr(u32 size, const void *ptr)
> > +{
> > + u64 ret = size == sizeof(u64) ? *(u64 *)ptr :
> > + size == sizeof(u32) ? *(u32 *)ptr :
> > + size == sizeof(u16) ? *(u16 *)ptr :
> > + *(u8 *)ptr;
> > +
> > + return ret;
> > +}
> Why is this needed? It looks like all the counters in
> hinic3_rx_queue_stats, hinic3_tx_queue_stats, and hinic3_port_stats are
> u64.

Thanks for the review. We will remove it in the next patchset.