From: Jakub Kicinski <jakub.kicin...@netronome.com>
Date: Fri, 19 May 2017 15:01:47 -0700

> Introduce a concept of an application.  For now it's just grouping
> pointers and serving as a layer of indirection.  It will help us
> weaken the dependency on nfp_net in ethtool code.  Later series
> will flesh out support for different apps in the driver.
> 
> Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com>
> Reviewed-by: Simon Horman <simon.hor...@netronome.com>
 ...
> +struct nfp_cpp *nfp_app_cpp(struct nfp_app *app)
> +{
> +     return app->cpp;
> +}
> +
> +struct nfp_pf *nfp_app_pf(struct nfp_app *app)
> +{
> +     return app->pf;
> +}

Don't create real function calls just to dereference pointers
like this.

Instead, if you absolutely _must_ do stuff like this, put it into
inline functions in a header file so that there is no overhead.

But honestly I would just make the core dereference the struct members
directly in the code and do away with these helpers.

Thanks.

Reply via email to