[PATCH v10 18/30] x86/resctrl: Fix types in resctrl_arch_mon_ctx_{alloc,free}() stubs

James Morse posted 30 patches 9 months ago
There is a newer version of this series
[PATCH v10 18/30] x86/resctrl: Fix types in resctrl_arch_mon_ctx_{alloc,free}() stubs
Posted by James Morse 9 months ago
resctrl_arch_mon_ctx_alloc() and resctrl_arch_mon_ctx_free() take an enum
resctrl_event_id that is al;ready defined in resctrl_types.h to be
accessible to asm/resctrl.h.

The x86 stubs take an int. Fix that.

Signed-off-by: James Morse <james.morse@arm.com>
Tested-by: Babu Moger <babu.moger@amd.com>
Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
---
Changes since v9:
 * Removed two stray semicolons.
 * Reworded the commit message.

Changes since v8:
 * This patch is new.
---
 arch/x86/include/asm/resctrl.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/resctrl.h b/arch/x86/include/asm/resctrl.h
index 7a39728b0743..a2e20fe90a2c 100644
--- a/arch/x86/include/asm/resctrl.h
+++ b/arch/x86/include/asm/resctrl.h
@@ -194,14 +194,16 @@ static inline u32 resctrl_arch_rmid_idx_encode(u32 ignored, u32 rmid)
 
 /* x86 can always read an rmid, nothing needs allocating */
 struct rdt_resource;
-static inline void *resctrl_arch_mon_ctx_alloc(struct rdt_resource *r, int evtid)
+static inline void *resctrl_arch_mon_ctx_alloc(struct rdt_resource *r,
+					       enum resctrl_event_id evtid)
 {
 	might_sleep();
 	return NULL;
-};
+}
 
-static inline void resctrl_arch_mon_ctx_free(struct rdt_resource *r, int evtid,
-					     void *ctx) { };
+static inline void resctrl_arch_mon_ctx_free(struct rdt_resource *r,
+					     enum resctrl_event_id evtid,
+					     void *ctx) { }
 
 u64 resctrl_arch_get_prefetch_disable_bits(void);
 int resctrl_arch_pseudo_lock_fn(void *_plr);
-- 
2.39.5
Re: [PATCH v10 18/30] x86/resctrl: Fix types in resctrl_arch_mon_ctx_{alloc,free}() stubs
Posted by Reinette Chatre 9 months ago
Hi James,

On 5/8/25 10:18 AM, James Morse wrote:
> resctrl_arch_mon_ctx_alloc() and resctrl_arch_mon_ctx_free() take an enum
> resctrl_event_id that is al;ready defined in resctrl_types.h to be

al;ready -> already

> accessible to asm/resctrl.h.
> 
> The x86 stubs take an int. Fix that.
> 
> Signed-off-by: James Morse <james.morse@arm.com>
> Tested-by: Babu Moger <babu.moger@amd.com>
> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
> ---

With typo fixed:

| Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>

Reinette
Re: [PATCH v10 18/30] x86/resctrl: Fix types in resctrl_arch_mon_ctx_{alloc,free}() stubs
Posted by James Morse 9 months ago
Hi Reinette,

On 08/05/2025 23:45, Reinette Chatre wrote:
> On 5/8/25 10:18 AM, James Morse wrote:
>> resctrl_arch_mon_ctx_alloc() and resctrl_arch_mon_ctx_free() take an enum
>> resctrl_event_id that is al;ready defined in resctrl_types.h to be
> 
> al;ready -> already

Bah - me and my fat fingers!


>> accessible to asm/resctrl.h.
>>
>> The x86 stubs take an int. Fix that.
>>
>> Signed-off-by: James Morse <james.morse@arm.com>
>> Tested-by: Babu Moger <babu.moger@amd.com>
>> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
>> ---
> 
> With typo fixed:
> 
> | Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>


Thanks!

James