From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: hannes@stressinduktion.org, netdev@vger.kernel.org,
netfilter-devel@vger.kernel.org, pablo@netfilter.org,
jiri@resnulli.us
Subject: Re: [PATCH 1/4] netfilter: Add nf_hook_state initializer function.
Date: Tue, 7 Apr 2015 09:45:35 -0700 [thread overview]
Message-ID: <20150407164530.GA6008@Alexeis-MBP.westell.com> (raw)
In-Reply-To: <20150407.115821.441881623894604515.davem@davemloft.net>
On Tue, Apr 07, 2015 at 11:58:21AM -0400, David Miller wrote:
> From: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Date: Tue, 07 Apr 2015 15:41:21 +0200
>
> > Minor suggestion:
> >
> > I think we can return the structure as a whole:
> >
> > static inline struct nf_hook_state nf_hook_state_init(unsigned int hook,
> > ...).
> >
> > Being static inline it should not make any difference.
>
> If by some insane possibility this does not get inlined, this structure
> gets copied to and from the kernel stack on some cpu ABIs in order to
> return it.
>
> Never return structures from functions, ever.
+1
I bet Dave alluding to insane sparc psABI requirements in that area.
Some horror stories there.
Never return structures. Ever!
prev parent reply other threads:[~2015-04-07 16:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-06 2:18 [PATCH 1/4] netfilter: Add nf_hook_state initializer function David Miller
2015-04-07 13:41 ` Hannes Frederic Sowa
2015-04-07 15:58 ` David Miller
2015-04-07 16:45 ` Alexei Starovoitov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150407164530.GA6008@Alexeis-MBP.westell.com \
--to=alexei.starovoitov@gmail.com \
--cc=davem@davemloft.net \
--cc=hannes@stressinduktion.org \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).