[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <170542c319f6b38330a3029f1f35594b8154763e.camel@sipsolutions.net>
Date: Thu, 24 Oct 2024 16:31:44 +0200
From: Johannes Berg <johannes@...solutions.net>
To: Sabrina Dubroca <sd@...asysnail.net>
Cc: linux-wireless@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [RFC PATCH 2/2] net: convert to nla_get_*_default()
On Thu, 2024-10-24 at 16:28 +0200, Sabrina Dubroca wrote:
>
>
> Not really familiar with spatch, but I'm guessing this won't cover:
> val = attr ? getter(attr) : default;
True, we could add
-val = attr ? fn(attr) : def;
+val = dfn(attr);
in the spatch for that.
But also see my other mail - the spatch can only be used to suggest
places to change, need to review them still due to integer type (both
signedness and width) issues.
> See macsec_validate_attr in drivers/net/macsec.c for some
> examples. There are also some cases where we have "if (data &&
> data[IFLA_MACSEC_*])" guarding the attribute fetch
> (drivers/net/macvlan.c does that too), but I guess you can't really
> cover that without adding some kind of "default_with_cond" helpers.
>
Yeah if there's some additional condition then I guess we just keep the
existing code.
johannes
Powered by blists - more mailing lists