Re: [PATCH v2 03/14] (RFC-only) config: add kvi arg to config_fn_t

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

 



On 02/06/2023 17:46, Glen Choo wrote:
Phillip Wood <phillip.wood123@xxxxxxxxx> writes:
As an aside, I think we'd also want a couple of helpers for matching
keys so we can just write kvi_match_key(kvi, "user.name") or
kvi_skip_key_prefix(kvi, "core.", &p) rather than having to extract the
key name first.

Yes, and that would also abstract over implementation details like
matching keys using strcasecmp() and not strcmp(). For reasons like
this, I think your proposal paves the way for a harder-to-misuse API.

I still have some nagging, probably irrational fear that consolidating
all of the config_fn_t args is trickier to manage than adding a single
key_value_info arg. It definitely *sounds* trickier, but I can't really
think of a real downside.

Maybe I just have to try it and send the result for others to consider.

That's probably the best way to see if it is an improvement - you can always blame me if it turns out not to be! Hopefully it isn't too much work to add enough api to be able to convert a couple of config_fn_t functions to see how it pans out.

Best Wishes

Phillip



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux