]> git.baikalelectronics.ru Git - kernel.git/commitdiff
soc: fsl: qe: make cpm_muram_offset take a const void* argument
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Tue, 19 Jan 2021 15:07:47 +0000 (16:07 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 21 Jan 2021 20:19:55 +0000 (12:19 -0800)
Allow passing const-qualified pointers without requiring a cast in the
caller.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Acked-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/soc/fsl/qe/qe_common.c
include/soc/fsl/qe/qe.h

index 497a7e0fd0272a09dbb38047fb41514b611d1165..b81cd1b2e4a05f3e06e23c125f5c22a3485fa168 100644 (file)
@@ -223,7 +223,7 @@ void __iomem *cpm_muram_addr(unsigned long offset)
 }
 EXPORT_SYMBOL(cpm_muram_addr);
 
-unsigned long cpm_muram_offset(void __iomem *addr)
+unsigned long cpm_muram_offset(const void __iomem *addr)
 {
        return addr - (void __iomem *)muram_vbase;
 }
index 3feddfec9f87d0635d5da717fef33a17a8d37e5d..8ee3747433c0c5f575bee7a290523d1512a8d9b7 100644 (file)
@@ -102,7 +102,7 @@ s32 cpm_muram_alloc(unsigned long size, unsigned long align);
 void cpm_muram_free(s32 offset);
 s32 cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
 void __iomem *cpm_muram_addr(unsigned long offset);
-unsigned long cpm_muram_offset(void __iomem *addr);
+unsigned long cpm_muram_offset(const void __iomem *addr);
 dma_addr_t cpm_muram_dma(void __iomem *addr);
 #else
 static inline s32 cpm_muram_alloc(unsigned long size,
@@ -126,7 +126,7 @@ static inline void __iomem *cpm_muram_addr(unsigned long offset)
        return NULL;
 }
 
-static inline unsigned long cpm_muram_offset(void __iomem *addr)
+static inline unsigned long cpm_muram_offset(const void __iomem *addr)
 {
        return -ENOSYS;
 }