Re: [PATCH net-next v6 1/2] dinghai: add ZTE network driver support

From: Andrew Lunn

Date: Tue Jun 16 2026 - 15:39:30 EST


> +++ b/drivers/net/ethernet/zte/dinghai/en_pf.h
> +static inline void *dh_core_alloc_priv(struct dh_core_dev *dh_dev,
> + size_t size)
> +{
> + void *priv = kzalloc(size, GFP_KERNEL);
> +
> + if (priv)
> + dh_dev->priv = priv;
> + return priv;
> +}
> +
> +static inline void dh_core_free_priv(struct dh_core_dev *dh_dev)
> +{
> + kfree(dh_dev->priv);
> +}

It is unusual for these to be inline functions in a header. Why is
this?

Andrew