From b5d56750c9bd55d6aee7239880bfaeab4135be36 Mon Sep 17 00:00:00 2001 From: Juxin Gao Date: Fri, 12 Dec 2025 16:07:42 +0800 Subject: [PATCH 1/2] xsched: Fix compilation by adding xsched_attr to syscalls.h hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IDCMKR ----------------------------------------- Add the necessary struct xsched_attr to include/linux/syscalls.h to make the definition of 'struct xsched_attr' visible during compilation. This change addresses the following build errors and warnings: - Warning: 'struct xsched_attr' declared inside parameter list will not be visible outside of this definition or declaration. - Error: conflicting types for 'sys_xsched_setattr' and 'sys_xsched_getattr' The inclusion of the header ensures consistent type visibility between the declaration and definition of the system calls involving struct xsched_attr, preventing type conflicts Fixes: 7d2bb3c7646c ("xsched: fix compile error when CONFIG_XCU_SCHEDULER is disabled") Signed-off-by: Juxin Gao --- include/linux/syscalls.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 2e7b2c57c8c0..959170ccad96 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -75,6 +75,7 @@ enum landlock_rule_type; struct cachestat_range; struct cachestat; struct vstream_args; +struct xsched_attr; #include #include -- Gitee From 8a58be7443bf3de385f723e3adf5c93215c01183 Mon Sep 17 00:00:00 2001 From: Juxin Gao Date: Fri, 12 Dec 2025 15:17:01 +0800 Subject: [PATCH 2/2] xsched: simplify logging macros by removing redundant pr_fmt usage hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IDCMKR ----------------------------------------- The existing logging macros (XSCHED_INFO, XSCHED_ERR, etc.) in xsched.h wrapped the prefix string with pr_fmt(), which is unnecessary since the pr_*() functions already handle pr_fmt() internally. This caused compiler warnings about "pr_fmt" macro receiving too many arguments when the macros were used with additional parameters. The fix involves: 1. Removing the local definition of pr_fmt since it's already defined in printk.h with proper guarding 2. Simplifying the XSCHED_* macros to directly concatenate the prefix string with the format string 3. Maintaining the same log output format while eliminating the redundant pr_fmt() wrapper This change resolves the compilation errors while preserving the original logging functionality and output format. Fixes: 7d2bb3c7646c ("xsched: fix compile error when CONFIG_XCU_SCHEDULER is disabled") Signed-off-by: Juxin Gao --- include/linux/xsched.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/include/linux/xsched.h b/include/linux/xsched.h index d21393ac82d6..46fe6ae2bc77 100644 --- a/include/linux/xsched.h +++ b/include/linux/xsched.h @@ -9,26 +9,22 @@ #include #include -#ifndef pr_fmt -#define pr_fmt(fmt) fmt -#endif - #define XSCHED_LOG_PREFIX "XSched" #define XSCHED_INFO(fmt, ...) \ - pr_info(pr_fmt(XSCHED_LOG_PREFIX " [INFO]: " fmt), ##__VA_ARGS__) + pr_info(XSCHED_LOG_PREFIX " [INFO]: " fmt, ##__VA_ARGS__) #define XSCHED_ERR(fmt, ...) \ - pr_err(pr_fmt(XSCHED_LOG_PREFIX " [ERROR]: " fmt), ##__VA_ARGS__) + pr_err(XSCHED_LOG_PREFIX " [ERROR]: " fmt, ##__VA_ARGS__) #define XSCHED_WARN(fmt, ...) \ - pr_warn(pr_fmt(XSCHED_LOG_PREFIX " [WARNING]: " fmt), ##__VA_ARGS__) + pr_warn(XSCHED_LOG_PREFIX " [WARNING]: " fmt, ##__VA_ARGS__) /* * Debug specific prints for XSched */ #define XSCHED_DEBUG(fmt, ...) \ - pr_debug(pr_fmt(XSCHED_LOG_PREFIX " [DEBUG]: " fmt), ##__VA_ARGS__) + pr_debug(XSCHED_LOG_PREFIX " [DEBUG]: " fmt, ##__VA_ARGS__) #define XSCHED_CALL_STUB() \ XSCHED_DEBUG(" -----* %s @ %s called *-----\n", __func__, __FILE__) -- Gitee