Search Linux Wireless

Re: [RFC PATCH 2/2] net: convert to nla_get_*_default()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux