Re: [PATCH v7 03/13] arch/x86: Re-arrange RDT init code

From: Borislav Petkov
Date: Wed Nov 14 2018 - 14:06:05 EST


On Fri, Nov 09, 2018 at 08:52:29PM +0000, Moger, Babu wrote:
> Separate the call sequence for rdt_quirks and MBA feature.
> This is in preparation to handle vendor differences in these
> call sequences.
>
> Signed-off-by: Babu Moger <babu.moger@xxxxxxx>
> ---
> arch/x86/kernel/cpu/resctrl.c | 29 +++++++++++++++++++++++------
> 1 file changed, 23 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/resctrl.c b/arch/x86/kernel/cpu/resctrl.c
> index 5d526dc45751..fd5320dddddc 100644
> --- a/arch/x86/kernel/cpu/resctrl.c
> +++ b/arch/x86/kernel/cpu/resctrl.c
> @@ -794,6 +794,16 @@ static bool __init rdt_cpu_has(int flag)
> return ret;
> }
>
> +static __init bool rdt_mba_config(void)
> +{
> + if (rdt_cpu_has(X86_FEATURE_MBA)) {
> + if (rdt_get_mem_config(&rdt_resources_all[RDT_RESOURCE_MBA]))
> + return true;

Or simpler:

if (rdt_cpu_has(X86_FEATURE_MBA))
return rdt_get_mem_config(&rdt_resources_all[RDT_RESOURCE_MBA]);

return false;

as rdt_get_mem_config() already returns bool.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.