[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 3 Mar 2020 10:31:27 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: Jacob Keller <jacob.e.keller@...el.com>
Cc: netdev@...r.kernel.org, valex@...lanox.com, linyunsheng@...wei.com,
lihong.yang@...el.com, kuba@...nel.org
Subject: Re: [RFC PATCH v2 14/22] devlink: implement DEVLINK_CMD_REGION_NEW
Mon, Mar 02, 2020 at 11:35:24PM CET, jacob.e.keller@...el.com wrote:
>
>
>On 3/2/2020 9:41 AM, Jiri Pirko wrote:
>>> struct devlink_region_ops {
>>> const char *name;
>>> void (*destructor)(const void *data);
>>> + int (*snapshot)(struct devlink *devlink, struct netlink_ext_ack *extack,
>>> + u8 **data);
>>
>> Please have the same type here and for destructor. "u8 *" I guess.
>>
>
>So... if I use void **data, this ends up looking a little weird because
>core code has to cast to (void **)...
>
>I agree it looks a bit odd to use u8 ** for snapshot and void * for the
>destructor.
>
>I really do not want to change destructor to u8 *, because that makes
>callers have to write a wrapper function if their destructor is simply
>kvfree.
>
>I'm ok with the cast to (void **) but it does seem a bit ugly.
>
>Thoughts on which approach to take, or to leave this as is?
Yep
>
>Thanks,
>Jake
Powered by blists - more mailing lists