diff mbox series

[net-next,v2,02/17] soc: fsl: qe: make cpm_muram_offset take a const void* argument

Message ID 20210119150802.19997-3-rasmus.villemoes@prevas.dk (mailing list archive)
State Accepted
Commit e8e507a8ac90d48053dfdea9d4855495b0204956
Delegated to: Netdev Maintainers
Headers show
Series ucc_geth improvements | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count fail Series longer than 15 patches
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 3 maintainers not CCed: linuxppc-dev@lists.ozlabs.org gustavoars@kernel.org linux-arm-kernel@lists.infradead.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 98 this patch: 98
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 24 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 97 this patch: 97
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Rasmus Villemoes Jan. 19, 2021, 3:07 p.m. UTC
Allow passing const-qualified pointers without requiring a cast in the
caller.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
---
 drivers/soc/fsl/qe/qe_common.c | 2 +-
 include/soc/fsl/qe/qe.h        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Leo Li Jan. 19, 2021, 6:42 p.m. UTC | #1
> -----Original Message-----
> From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
> Sent: Tuesday, January 19, 2021 9:08 AM
> To: netdev@vger.kernel.org
> Cc: Leo Li <leoyang.li@nxp.com>; David S . Miller <davem@davemloft.net>;
> Qiang Zhao <qiang.zhao@nxp.com>; Andrew Lunn <andrew@lunn.ch>;
> Christophe Leroy <christophe.leroy@csgroup.eu>; Jakub Kicinski
> <kuba@kernel.org>; jocke@infinera.com <joakim.tjernlund@infinera.com>;
> Rasmus Villemoes <rasmus.villemoes@prevas.dk>
> Subject: [PATCH net-next v2 02/17] soc: fsl: qe: make cpm_muram_offset
> take a const void* argument
> 
> Allow passing const-qualified pointers without requiring a cast in the
> caller.

Acked-by: Li Yang <leoyang.li@nxp.com>

> 
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
> ---
>  drivers/soc/fsl/qe/qe_common.c | 2 +-
>  include/soc/fsl/qe/qe.h        | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/soc/fsl/qe/qe_common.c
> b/drivers/soc/fsl/qe/qe_common.c
> index 75075591f630..0fbdc965c4cb 100644
> --- a/drivers/soc/fsl/qe/qe_common.c
> +++ b/drivers/soc/fsl/qe/qe_common.c
> @@ -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;
>  }
> diff --git a/include/soc/fsl/qe/qe.h b/include/soc/fsl/qe/qe.h
> index 3feddfec9f87..8ee3747433c0 100644
> --- a/include/soc/fsl/qe/qe.h
> +++ b/include/soc/fsl/qe/qe.h
> @@ -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;
>  }
> --
> 2.23.0
diff mbox series

Patch

diff --git a/drivers/soc/fsl/qe/qe_common.c b/drivers/soc/fsl/qe/qe_common.c
index 75075591f630..0fbdc965c4cb 100644
--- a/drivers/soc/fsl/qe/qe_common.c
+++ b/drivers/soc/fsl/qe/qe_common.c
@@ -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;
 }
diff --git a/include/soc/fsl/qe/qe.h b/include/soc/fsl/qe/qe.h
index 3feddfec9f87..8ee3747433c0 100644
--- a/include/soc/fsl/qe/qe.h
+++ b/include/soc/fsl/qe/qe.h
@@ -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;
 }