Re: [PATCH v5 16/20] x86/resctrl: Report "Unassigned" for MBM events in ABMC mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



…
> +++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
…
> @@ -609,12 +609,21 @@ int rdtgroup_mondata_show(struct seq_file *m, void *arg)
…
+		if (resctrl_arch_get_abmc_enabled()) {
+			index = mon_event_config_index_get(evtid);
+			if (rdtgrp->mon.cntr_id[index] == MON_CNTR_UNSET)
+				seq_puts(m, "Unassigned\n");
+			else
+				seq_puts(m, "Unavailable\n");
+		} else {
…

I suggest to restrict the scope for the shown local variable to this if branch.

How do you think about to apply a code variant like the following?

			int index = mon_event_config_index_get(evtid);

			seq_puts(m,
				 (rdtgrp->mon.cntr_id[index] == MON_CNTR_UNSET
				 ? "Unassigned\n"
                                 : "Unavailable\n") );


Regards,
Markus





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux