From: Jakub Kicinski <redacted>
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 <redacted>
Reviewed-by: Simon Horman <redacted>
...
+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.