Thread (15 messages) flat view 15 messages, 2 authors, 2017-05-21

Re: [PATCH net-next 05/13] nfp: introduce very minimal nfp_app

From: David Miller <davem@davemloft.net>
Date: 2017-05-21 17:23:32

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help