backports.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hauke Mehrtens <hauke@hauke-m.de>
To: AceLan Kao <acelan.kao@canonical.com>,
	mcgrof@kernel.org, backports@vger.kernel.org
Subject: Re: [PATCH 2/2] backports: update backport/backport-include/net/netlink.h
Date: Tue, 19 Mar 2019 22:50:22 +0100	[thread overview]
Message-ID: <c1efbd7a-7bce-2c34-8be8-946c77eecd8e@hauke-m.de> (raw)
In-Reply-To: <20190319060915.19849-3-acelan.kao@canonical.com>

On 3/19/19 7:09 AM, AceLan Kao wrote:
> Add new macros introduced from
>    23323289b154 netlink: reduce NLA_POLICY_NESTED{,_ARRAY} arguments
> 
> Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
> ---
>  backport/backport-include/net/netlink.h | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/backport/backport-include/net/netlink.h b/backport/backport-include/net/netlink.h
> index 4af73631..6f6630ae 100644
> --- a/backport/backport-include/net/netlink.h
> +++ b/backport/backport-include/net/netlink.h
> @@ -59,10 +59,14 @@ struct backport_nla_policy {
>  #define NLA_POLICY_ETH_ADDR		NLA_POLICY_EXACT_LEN(ETH_ALEN)
>  #define NLA_POLICY_ETH_ADDR_COMPAT	NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN)
>  
> -#define NLA_POLICY_NESTED(maxattr, policy) \
> +#define _NLA_POLICY_NESTED(maxattr, policy) \
>  	{ .type = NLA_NESTED, .validation_data = policy, .len = maxattr }
> -#define NLA_POLICY_NESTED_ARRAY(maxattr, policy) \
> +#define _NLA_POLICY_NESTED_ARRAY(maxattr, policy) \
>  	{ .type = NLA_NESTED_ARRAY, .validation_data = policy, .len = maxattr }
> +#define NLA_POLICY_NESTED(policy) \
> +	_NLA_POLICY_NESTED(ARRAY_SIZE(policy) - 1, policy)
> +#define NLA_POLICY_NESTED_ARRAY(policy) \
> +	_NLA_POLICY_NESTED_ARRAY(ARRAY_SIZE(policy) - 1, policy)
>  
>  #define __NLA_ENSURE(condition) (sizeof(char[1 - 2*!(condition)]) - 1)
>  #define NLA_ENSURE_INT_TYPE(tp)				\
> 

This is only added for kernel < 4.20, there is a ifdef around, there is
also a backport needed for kernel 4.20 till 5.0.

Hauke
--
To unsubscribe from this list: send the line "unsubscribe backports" in

  reply	other threads:[~2019-03-19 21:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19  6:09 [PATCH 0/2] backports: to make iwlwifi compile under v5.1-rc1 AceLan Kao
2019-03-19  6:09 ` [PATCH 1/2] backports: remove mt76.patch AceLan Kao
2019-03-19  6:09 ` [PATCH 2/2] backports: update backport/backport-include/net/netlink.h AceLan Kao
2019-03-19 21:50   ` Hauke Mehrtens [this message]
2019-03-20  2:34     ` AceLan Kao

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=c1efbd7a-7bce-2c34-8be8-946c77eecd8e@hauke-m.de \
    --to=hauke@hauke-m.de \
    --cc=acelan.kao@canonical.com \
    --cc=backports@vger.kernel.org \
    --cc=mcgrof@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;
as well as URLs for NNTP newsgroup(s).