lkml.org 
[lkml]   [2023]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 1/8] x86/resctrl: Prepare for new domain scope
Hello,

On 2023-08-29 at 16:44:19 -0700, Tony Luck wrote:
>diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
>index 030d3b409768..0d3bae523ecb 100644
>--- a/arch/x86/kernel/cpu/resctrl/core.c
>+++ b/arch/x86/kernel/cpu/resctrl/core.c
>@@ -487,6 +487,21 @@ static int arch_domain_mbm_alloc(u32 num_rmid, struct rdt_hw_domain *hw_dom)
> return 0;
> }
>
>+static int get_domain_id_from_scope(int cpu, enum resctrl_scope scope)
>+{
>+ switch (scope) {
>+ case RESCTRL_L3_CACHE:
>+ return get_cpu_cacheinfo_id(cpu, 3);
>+ case RESCTRL_L2_CACHE:
>+ return get_cpu_cacheinfo_id(cpu, 2);
>+ default:
>+ WARN_ON_ONCE(1);
>+ break;
>+ }
>+
>+ return -1;
>+}

Is there some reason the "return -1" is outside of the default switch
case?

Other switch statements in this patch do have returns inside the default
case, is this one different in some way?

--
Kind regards
Maciej Wieczór-Retman

\
 
 \ /
  Last update: 2023-08-30 21:09    [W:0.913 / U:0.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site