From 3f100dd61ad4ee7c1fb6a44775a928dcdba7515b Mon Sep 17 00:00:00 2001 From: Pengpeng Hou Date: Tue, 10 Mar 2026 08:08:00 +0000 Subject: xen/grant-table: guard gnttab_suspend/resume with CONFIG_HIBERNATE_CALLBACKS In current linux.git, gnttab_suspend() and gnttab_resume() are defined and declared unconditionally. However, their only in-tree callers reside in drivers/xen/manage.c, which are guarded by CONFIG_HIBERNATE_CALLBACKS. Match the helper scope to their callers by wrapping the definitions in CONFIG_HIBERNATE_CALLBACKS and providing no-op stubs in the header. This fixes the config-scope mismatch and reduces the code footprint when hibernation callbacks are disabled. Signed-off-by: Pengpeng Hou Signed-off-by: Juergen Gross Message-ID: <20260310080800.742223-1-pengpeng.hou@isrc.iscas.ac.cn> --- include/xen/grant_table.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index 69ac6d80a006..a33a60a2ea72 100644 --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h @@ -84,8 +84,20 @@ struct gntab_unmap_queue_data }; int gnttab_init(void); +#ifdef CONFIG_HIBERNATE_CALLBACKS int gnttab_suspend(void); int gnttab_resume(void); +#else +static inline int gnttab_suspend(void) +{ + return 0; +} + +static inline int gnttab_resume(void) +{ + return 0; +} +#endif int gnttab_grant_foreign_access(domid_t domid, unsigned long frame, int readonly); -- cgit v1.2.3