From a529f8de260e33237204f18c6c1540212a9653c7 Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Mon, 6 Nov 2017 14:15:39 +0100 Subject: ARM: OMAP2+: CM: make some pointers and function arguments as const Make the pointer cm_ll_data of type cm_ll_data as const as it does not modify the fields of the structure it points too. After this change, make the argument of cm_register function as const as it is used to initialise cm_ll_data or used inside an if condition. Make the pointer argument of cm_unregister function as const as it is only used inside an if condition. Add const to the function prototypes too. Signed-off-by: Bhumika Goyal Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/cm_common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-omap2/cm_common.c') diff --git a/arch/arm/mach-omap2/cm_common.c b/arch/arm/mach-omap2/cm_common.c index d555791cf349..de9cdce27b83 100644 --- a/arch/arm/mach-omap2/cm_common.c +++ b/arch/arm/mach-omap2/cm_common.c @@ -29,7 +29,7 @@ * common CM functions */ static struct cm_ll_data null_cm_ll_data; -static struct cm_ll_data *cm_ll_data = &null_cm_ll_data; +static const struct cm_ll_data *cm_ll_data = &null_cm_ll_data; /* cm_base: base virtual address of the CM IP block */ struct omap_domain_base cm_base; @@ -186,7 +186,7 @@ int omap_cm_module_disable(u8 part, u16 inst, u16 clkctrl_offs) * is NULL, or -EEXIST if cm_register() has already been called * without an intervening cm_unregister(). */ -int cm_register(struct cm_ll_data *cld) +int cm_register(const struct cm_ll_data *cld) { if (!cld) return -EINVAL; @@ -210,7 +210,7 @@ int cm_register(struct cm_ll_data *cld) * -EINVAL if @cld is NULL or if @cld does not match the struct * cm_ll_data * previously registered by cm_register(). */ -int cm_unregister(struct cm_ll_data *cld) +int cm_unregister(const struct cm_ll_data *cld) { if (!cld || cm_ll_data != cld) return -EINVAL; -- cgit v1.2.3