On 13. 03. 24 14:47, Michal Schmidt wrote:
-/* a small macro to shorten up some long lines */ -#define INTREG I40E_PFINT_DYN_CTLN +static inline u32 i40e_buildreg_swint(int type) +{ + u32 val; + + /* 1. Enable the interrupt + * 2. Do not modify any ITR interval + * 3. Trigger a SW interrupt specified by type + */ + val = I40E_PFINT_DYN_CTLN_INTENA_MASK | + I40E_PFINT_DYN_CTLN_ITR_INDX_MASK | /* set noitr */ + I40E_PFINT_DYN_CTLN_SWINT_TRIG_MASK | + I40E_PFINT_DYN_CTLN_SW_ITR_INDX_ENA_MASK | + FIELD_PREP(I40E_PFINT_DYN_CTLN_SW_ITR_INDX_MASK, type); + + return val; +}This function is called only from one place and with a constant argument. Does it really need to be a function, as opposed to a constant? Or are you going to add more callers soon?
This can be reused also from i40e_force_wb() but I didn't want to make such refactors in this fix. Lets do it later in -next.
Ivan
