Skip to content

Commit 6846dc1

Browse files
babumogerbp3tk0v
authored andcommitted
x86/resctrl: Simplify rftype flag definitions
The rftype flags are bitmaps used for adding files under the resctrl filesystem. Some of these bitmap defines have one extra level of indirection which is not necessary. Drop the RF_* defines and simplify the macros. [ bp: Massage commit message. ] Signed-off-by: Babu Moger <babu.moger@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Peter Newman <peternewman@google.com> Reviewed-by: Tan Shaopeng <tan.shaopeng@jp.fujitsu.com> Reviewed-by: Fenghua Yu <fenghua.yu@intel.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Tested-by: Peter Newman <peternewman@google.com> Tested-by: Tan Shaopeng <tan.shaopeng@jp.fujitsu.com> Link: https://lore.kernel.org/r/20231017002308.134480-3-babu.moger@amd.com
1 parent fe2a20e commit 6846dc1

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

arch/x86/kernel/cpu/resctrl/internal.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,9 @@ struct rdtgroup {
243243
*/
244244
#define RFTYPE_INFO BIT(0)
245245
#define RFTYPE_BASE BIT(1)
246-
#define RF_CTRLSHIFT 4
247-
#define RF_MONSHIFT 5
248-
#define RF_TOPSHIFT 6
249-
#define RFTYPE_CTRL BIT(RF_CTRLSHIFT)
250-
#define RFTYPE_MON BIT(RF_MONSHIFT)
251-
#define RFTYPE_TOP BIT(RF_TOPSHIFT)
246+
#define RFTYPE_CTRL BIT(4)
247+
#define RFTYPE_MON BIT(5)
248+
#define RFTYPE_TOP BIT(6)
252249
#define RFTYPE_RES_CACHE BIT(8)
253250
#define RFTYPE_RES_MB BIT(9)
254251
#define RF_CTRL_INFO (RFTYPE_INFO | RFTYPE_CTRL)

arch/x86/kernel/cpu/resctrl/rdtgroup.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3260,7 +3260,11 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn,
32603260
goto out_destroy;
32613261
}
32623262

3263-
files = RFTYPE_BASE | BIT(RF_CTRLSHIFT + rtype);
3263+
if (rtype == RDTCTRL_GROUP)
3264+
files = RFTYPE_BASE | RFTYPE_CTRL;
3265+
else
3266+
files = RFTYPE_BASE | RFTYPE_MON;
3267+
32643268
ret = rdtgroup_add_files(kn, files);
32653269
if (ret) {
32663270
rdt_last_cmd_puts("kernfs fill error\n");

0 commit comments

Comments
 (0)