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