Re: [PATCH v7 16/24] x86/resctrl: Add a helper to read a closid's configuration

From: Borislav Petkov
Date: Wed Aug 11 2021 - 11:49:53 EST


On Wed, Jul 28, 2021 at 05:06:29PM +0000, James Morse wrote:
> +void resctrl_arch_get_config(struct rdt_resource *r, struct rdt_domain *d,
> + u32 closid, u32 *value)
> +{
> + struct rdt_hw_domain *hw_dom = resctrl_to_arch_dom(d);
> +
> + if (!is_mba_sc(r))
> + *value = hw_dom->ctrl_val[closid];
> + else
> + *value = hw_dom->mbps_val[closid];

I don't like functions which are of void type but which still return a
value through an arg pointer. Please send a cleanup ontop of the whole
set converting it to return u32 as the mbps value instead.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette