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 <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Reviewed-by: Peter Newman <[email protected]> Reviewed-by: Tan Shaopeng <[email protected]> Reviewed-by: Fenghua Yu <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Tested-by: Peter Newman <[email protected]> Tested-by: Tan Shaopeng <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent fe2a20e commit 6846dc1

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

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)