Subject: Re: [PATCH net-next V3 02/15] devlink: define enum for attr types of dynamic attributes

From: Jakub Kicinski <[email-masked]>
Date: Tue, 29 Apr 2025 10:01:38 -0700

On Tue, 29 Apr 2025 13:49:16 +0200 Jiri Pirko wrote:
> >>Why do you keep the DEVLINK_PARAM_TYPE_* defines around?
> >>IMO it'd be fine to just use them directly instead of adding 
> >>the new enum, fmsg notwithstanding. But failing that we can rename 
> >>in the existing in-tree users to DEVLINK_VAR_ATTR_TYPE_* right?
> >>What does this translating back and forth buy us?  
> >
> >Sure, I can do that in a separate patch. I think I will send these
> >patchset separatelly prior to Saeed's patchset.  
> 
> Hmm, on a second thought, we expose DEVLINK_PARAM_TYPE_* to drivers to
> specify type of driver-specific params:
> git grep DEVLINK_PARAM_TYPE_
> I would like to keep it as part of devlink param api. Looks nicer to me.
> Downside is this switch-case, but who really cares?

Who cares about pointless, duplicated code? I do ✋️

Why do you think it's "nicer" to have DEVLINK_PARAM_TYPE_ and
DEVLINK_VAR_ATTR_TYPE_ be separate things if they define 
the same, exact, identical values?
If it's because DEVLINK_VAR_ATTR_TYPE_ has the word _ATTR in 
it then I totally agree, lets call it DEVLINK_VAR_TYPE_ :)