netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
To: netdev@vger.kernel.org
Cc: Li Yang <leoyang.li@nxp.com>,
	"David S . Miller" <davem@davemloft.net>,
	Zhao Qiang <qiang.zhao@nxp.com>, Andrew Lunn <andrew@lunn.ch>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Jakub Kicinski <kuba@kernel.org>,
	Joakim Tjernlund <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
Date: Tue, 19 Jan 2021 16:07:47 +0100	[thread overview]
Message-ID: <20210119150802.19997-3-rasmus.villemoes@prevas.dk> (raw)
In-Reply-To: <20210119150802.19997-1-rasmus.villemoes@prevas.dk>

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(-)

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


  parent reply	other threads:[~2021-01-19 18:29 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19 15:07 [PATCH net-next v2 00/17] ucc_geth improvements Rasmus Villemoes
2021-01-19 15:07 ` [PATCH net-next v2 01/17] ethernet: ucc_geth: remove unused read of temoder field Rasmus Villemoes
2021-01-19 15:07 ` Rasmus Villemoes [this message]
2021-01-19 18:42   ` [PATCH net-next v2 02/17] soc: fsl: qe: make cpm_muram_offset take a const void* argument Leo Li
2021-01-19 15:07 ` [PATCH net-next v2 03/17] soc: fsl: qe: store muram_vbase as a void pointer instead of u8 Rasmus Villemoes
2021-01-19 18:45   ` Li Yang
2021-01-19 15:07 ` [PATCH net-next v2 04/17] soc: fsl: qe: add cpm_muram_free_addr() helper Rasmus Villemoes
2021-01-19 18:46   ` Li Yang
2021-01-19 15:07 ` [PATCH net-next v2 05/17] ethernet: ucc_geth: use qe_muram_free_addr() Rasmus Villemoes
2021-01-19 15:07 ` [PATCH net-next v2 06/17] ethernet: ucc_geth: remove unnecessary memset_io() calls Rasmus Villemoes
2021-01-19 15:07 ` [PATCH net-next v2 07/17] ethernet: ucc_geth: replace kmalloc+memset by kzalloc Rasmus Villemoes
2021-01-19 15:07 ` [PATCH net-next v2 08/17] ethernet: ucc_geth: remove {rx,tx}_glbl_pram_offset from struct ucc_geth_private Rasmus Villemoes
2021-01-20  6:57   ` Christophe Leroy
2021-01-20 11:26     ` Rasmus Villemoes
2021-01-19 15:07 ` [PATCH net-next v2 09/17] ethernet: ucc_geth: factor out parsing of {rx,tx}-clock{,-name} properties Rasmus Villemoes
2021-01-19 15:07 ` [PATCH net-next v2 10/17] ethernet: ucc_geth: constify ugeth_primary_info Rasmus Villemoes
2021-01-19 15:07 ` [PATCH net-next v2 11/17] ethernet: ucc_geth: don't statically allocate eight ucc_geth_info Rasmus Villemoes
2021-01-20  7:02   ` Christophe Leroy
2021-01-20 11:25     ` Rasmus Villemoes
2021-01-20 11:30       ` Christophe Leroy
2021-01-19 15:07 ` [PATCH net-next v2 12/17] ethernet: ucc_geth: use UCC_GETH_{RX,TX}_BD_RING_ALIGNMENT macros directly Rasmus Villemoes
2021-01-19 15:07 ` [PATCH net-next v2 13/17] ethernet: ucc_geth: remove bd_mem_part and all associated code Rasmus Villemoes
2021-01-20  7:17   ` Christophe Leroy
2021-01-20 11:33     ` Rasmus Villemoes
2021-01-19 15:07 ` [PATCH net-next v2 14/17] ethernet: ucc_geth: replace kmalloc_array()+for loop by kcalloc() Rasmus Villemoes
2021-01-20  7:19   ` Christophe Leroy
2021-01-19 15:08 ` [PATCH net-next v2 15/17] ethernet: ucc_geth: add helper to replace repeated switch statements Rasmus Villemoes
2021-01-19 15:08 ` [PATCH net-next v2 16/17] ethernet: ucc_geth: inform the compiler that numQueues is always 1 Rasmus Villemoes
2021-01-19 15:08 ` [PATCH net-next v2 17/17] ethernet: ucc_geth: simplify rx/tx allocations Rasmus Villemoes
2021-01-19 17:52 ` [PATCH net-next v2 00/17] ucc_geth improvements Leo Li
2021-01-21 20:30 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210119150802.19997-3-rasmus.villemoes@prevas.dk \
    --to=rasmus.villemoes@prevas.dk \
    --cc=Joakim.Tjernlund@infinera.com \
    --cc=andrew@lunn.ch \
    --cc=christophe.leroy@csgroup.eu \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=leoyang.li@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=qiang.zhao@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).