netlink: reduce NLA_POLICY_NESTED{,_ARRAY} arguments
authorJohannes Berg <johannes.berg@intel.com>
Fri, 25 Jan 2019 09:08:28 +0000 (10:08 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 1 Feb 2019 10:06:55 +0000 (11:06 +0100)
commit23323289b1543b445d1f10aeab1bcfd84f2ca50a
treeebf5858e66a307631968e165bd788a1314991f2b
parent752cfee90d11e280d727617bf8d6df894141e157
netlink: reduce NLA_POLICY_NESTED{,_ARRAY} arguments

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>
include/net/netlink.h
net/wireless/nl80211.c