From: David Miller <davem@davemloft.net>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
johannes.berg@intel.com
Subject: Re: [PATCH net-next] netlink: reduce NLA_POLICY_NESTED{,_ARRAY} arguments
Date: Fri, 25 Jan 2019 11:04:03 -0800 (PST) [thread overview]
Message-ID: <20190125.110403.1859522316620338548.davem@davemloft.net> (raw)
In-Reply-To: <20190125090828.26361-1-johannes@sipsolutions.net>
From: Johannes Berg <johannes@sipsolutions.net>
Date: Fri, 25 Jan 2019 10:08:28 +0100
> From: Johannes Berg <johannes.berg@intel.com>
>
> In typical cases, there's no need to pass both the maxattr
> and the policy array pointer, as the maxattr should just be
> ARRAY_SIZE(policy) - 1. Therefore, to be less error prone,
> just remove the maxattr argument from the default macros
> and deduce the size accordingly.
>
> Leave the original macros with a leading underscore to use
> here and in case somebody needs to pass a policy pointer
> where the policy isn't declared in the same place and thus
> ARRAY_SIZE() cannot be used.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
> Dave, it looks like we're the only users of this right now,
> so let me know if you'd prefer I take it through my tree.
> Also, this conflicts with the fix I just made to the place
> where I got it wrong, but obviously the resolution is to
> just take the version without the maxattr argument.
Please take it through your tree in that case. It'll probably
be the more painless way to merge this.
next prev parent reply other threads:[~2019-01-25 19:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-25 9:08 [PATCH net-next] netlink: reduce NLA_POLICY_NESTED{,_ARRAY} arguments Johannes Berg
2019-01-25 19:04 ` David Miller [this message]
2019-01-25 19:34 ` Johannes Berg
2019-01-25 19:36 ` David Miller
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=20190125.110403.1859522316620338548.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=johannes.berg@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.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