From fcc32be06182b764672e85ba6f08fa7bb1a33a4d Mon Sep 17 00:00:00 2001 From: Elliot Berman Date: Mon, 12 Jun 2023 09:56:01 -0700 Subject: [PATCH] ANDROID: virt: gunyah: Sync with latest platform ops Const-ify the gh_rm_platform_ops. Syncs with the latest version of the platform ops: https://lore.kernel.org/all/20230613172054.3959700-15-quic_eberman@quicinc.com/ INFO: function symbol changed from 'int devm_gh_rm_register_platform_ops(struct device*, struct gh_rm_platform_ops*)' to 'int devm_gh_rm_register_platform_ops(struct device*, const struct gh_rm_platform_ops*)' CRC changed from 0xc4b20ef4 to 0x7fe0042f type changed from 'int(struct device*, struct gh_rm_platform_ops*)' to 'int(struct device*, const struct gh_rm_platform_ops*)' parameter 2 type changed from 'struct gh_rm_platform_ops*' to 'const struct gh_rm_platform_ops*' pointed-to type changed from 'struct gh_rm_platform_ops' to 'const struct gh_rm_platform_ops' qualifier const added function symbol changed from 'int gh_rm_register_platform_ops(struct gh_rm_platform_ops*)' to 'int gh_rm_register_platform_ops(const struct gh_rm_platform_ops*)' CRC changed from 0xc34a7803 to 0xfd11885c type changed from 'int(struct gh_rm_platform_ops*)' to 'int(const struct gh_rm_platform_ops*)' parameter 1 type changed from 'struct gh_rm_platform_ops*' to 'const struct gh_rm_platform_ops*' pointed-to type changed from 'struct gh_rm_platform_ops' to 'const struct gh_rm_platform_ops' qualifier const added function symbol changed from 'void gh_rm_unregister_platform_ops(struct gh_rm_platform_ops*)' to 'void gh_rm_unregister_platform_ops(const struct gh_rm_platform_ops*)' CRC changed from 0xc1f09d18 to 0x57f483b type changed from 'void(struct gh_rm_platform_ops*)' to 'void(const struct gh_rm_platform_ops*)' parameter 1 type changed from 'struct gh_rm_platform_ops*' to 'const struct gh_rm_platform_ops*' pointed-to type changed from 'struct gh_rm_platform_ops' to 'const struct gh_rm_platform_ops' qualifier const added Bug: 287037804 Change-Id: Iff37610b721c344ac8c6b1737830f6d1e8674d34 Signed-off-by: Elliot Berman --- drivers/virt/gunyah/gunyah_platform_hooks.c | 12 ++++++------ include/linux/gunyah_rsc_mgr.h | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/virt/gunyah/gunyah_platform_hooks.c b/drivers/virt/gunyah/gunyah_platform_hooks.c index 60da0e154e98..905515b4589e 100644 --- a/drivers/virt/gunyah/gunyah_platform_hooks.c +++ b/drivers/virt/gunyah/gunyah_platform_hooks.c @@ -9,7 +9,7 @@ #include "rsc_mgr.h" -static struct gh_rm_platform_ops *rm_platform_ops; +static const struct gh_rm_platform_ops *rm_platform_ops; static DECLARE_RWSEM(rm_platform_ops_lock); int gh_rm_platform_pre_mem_share(struct gh_rm *rm, struct gh_rm_mem_parcel *mem_parcel) @@ -36,7 +36,7 @@ int gh_rm_platform_post_mem_reclaim(struct gh_rm *rm, struct gh_rm_mem_parcel *m } EXPORT_SYMBOL_GPL(gh_rm_platform_post_mem_reclaim); -int gh_rm_register_platform_ops(struct gh_rm_platform_ops *platform_ops) +int gh_rm_register_platform_ops(const struct gh_rm_platform_ops *platform_ops) { int ret = 0; @@ -50,7 +50,7 @@ int gh_rm_register_platform_ops(struct gh_rm_platform_ops *platform_ops) } EXPORT_SYMBOL_GPL(gh_rm_register_platform_ops); -void gh_rm_unregister_platform_ops(struct gh_rm_platform_ops *platform_ops) +void gh_rm_unregister_platform_ops(const struct gh_rm_platform_ops *platform_ops) { down_write(&rm_platform_ops_lock); if (rm_platform_ops == platform_ops) @@ -61,10 +61,10 @@ EXPORT_SYMBOL_GPL(gh_rm_unregister_platform_ops); static void _devm_gh_rm_unregister_platform_ops(void *data) { - gh_rm_unregister_platform_ops(data); + gh_rm_unregister_platform_ops((const struct gh_rm_platform_ops *)data); } -int devm_gh_rm_register_platform_ops(struct device *dev, struct gh_rm_platform_ops *ops) +int devm_gh_rm_register_platform_ops(struct device *dev, const struct gh_rm_platform_ops *ops) { int ret; @@ -72,7 +72,7 @@ int devm_gh_rm_register_platform_ops(struct device *dev, struct gh_rm_platform_o if (ret) return ret; - return devm_add_action(dev, _devm_gh_rm_unregister_platform_ops, ops); + return devm_add_action(dev, _devm_gh_rm_unregister_platform_ops, (void *)ops); } EXPORT_SYMBOL_GPL(devm_gh_rm_register_platform_ops); diff --git a/include/linux/gunyah_rsc_mgr.h b/include/linux/gunyah_rsc_mgr.h index 5453c90fbe6a..bc55be6d8d33 100644 --- a/include/linux/gunyah_rsc_mgr.h +++ b/include/linux/gunyah_rsc_mgr.h @@ -167,15 +167,15 @@ struct gh_rm_platform_ops { }; #if IS_ENABLED(CONFIG_GUNYAH_PLATFORM_HOOKS) -int gh_rm_register_platform_ops(struct gh_rm_platform_ops *platform_ops); -void gh_rm_unregister_platform_ops(struct gh_rm_platform_ops *platform_ops); -int devm_gh_rm_register_platform_ops(struct device *dev, struct gh_rm_platform_ops *ops); +int gh_rm_register_platform_ops(const struct gh_rm_platform_ops *platform_ops); +void gh_rm_unregister_platform_ops(const struct gh_rm_platform_ops *platform_ops); +int devm_gh_rm_register_platform_ops(struct device *dev, const struct gh_rm_platform_ops *ops); #else -static inline int gh_rm_register_platform_ops(struct gh_rm_platform_ops *platform_ops) +static inline int gh_rm_register_platform_ops(const struct gh_rm_platform_ops *platform_ops) { return 0; } -static inline void gh_rm_unregister_platform_ops(struct gh_rm_platform_ops *platform_ops) { } +static inline void gh_rm_unregister_platform_ops(const struct gh_rm_platform_ops *platform_ops) { } static inline int devm_gh_rm_register_platform_ops(struct device *dev, - struct gh_rm_platform_ops *ops) { return 0; } + const struct gh_rm_platform_ops *ops) { return 0; } #endif #endif