public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes
@ 2023-04-15 11:17 Stanislav Kinsburskii
  2023-04-15 11:17 ` [PATCH 1/7] x86: asm/io.h: " Stanislav Kinsburskii
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Stanislav Kinsburskii @ 2023-04-15 11:17 UTC (permalink / raw)
  Cc: Matt Turner, x86, Stanislav Kinsburskii, Borislav Petkov,
	linux-ia64, Mark Brown, Richard Henderson, linux-kernel,
	Brian Cain, linux-mips, Geert Uytterhoeven, linux-alpha,
	linux-arch, Michael Ellerman, Linus Walleij, Jiaxun Yang,
	Bjorn Helgaas, Andrew Morton, Dave Hansen, Omar Sandoval,
	Helge Deller, linuxppc-dev, linux-hexagon, Thomas Bogendoerfer,
	Ivan Kokshaysky, Ingo Molnar, Arnd Bergmann, Florian Fainelli,
	Chris Down, Nicholas Piggin, Christophe Leroy, H. Peter Anvin,
	Thomas Gleixner

This series is aimed to address compilation warnings when a constant pointer
is passed to virt_to_phys and isa_virt_to_bus functions:

  warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ qualifier from pointer target type
  warning: passing argument 1 of ‘isa_virt_to_bus’ discards ‘const’ qualifier from pointer target type

The change(s) is the same for all architectures, but it's split into a series on
per-arch basis to simplify applying and testing on the maintainers side.

The following series implements...

---

Stanislav Kinsburskii (7):
      x86: asm/io.h: Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes
      alpha: asm/io.h: Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes
      mips: asm/io.h: Expect immutable pointer in isa_virt_to_bus prototype
      hexagon: asm/io.h: Expect immutable pointer in virt_to_phys prototype
      ia64: asm/io.h: Expect immutable pointer in virt_to_phys prototype
      powerpc: asm/io.h: Expect immutable pointer in virt_to_phys prototype
      asm-generic/io.h: Expect immutable pointer in virt_to_phys


 arch/alpha/include/asm/io.h   |    6 +++---
 arch/hexagon/include/asm/io.h |    2 +-
 arch/ia64/include/asm/io.h    |    2 +-
 arch/mips/include/asm/io.h    |    2 +-
 arch/powerpc/include/asm/io.h |    2 +-
 arch/x86/include/asm/io.h     |    4 ++--
 include/asm-generic/io.h      |    2 +-
 7 files changed, 10 insertions(+), 10 deletions(-)



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/7] x86: asm/io.h: Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes
  2023-04-15 11:17 [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes Stanislav Kinsburskii
@ 2023-04-15 11:17 ` Stanislav Kinsburskii
  2023-08-25  8:39   ` Linus Walleij
  2023-04-15 11:17 ` [PATCH 2/7] alpha: " Stanislav Kinsburskii
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 12+ messages in thread
From: Stanislav Kinsburskii @ 2023-04-15 11:17 UTC (permalink / raw)
  Cc: Stanislav Kinsburskii, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
	Geert Uytterhoeven, Arnd Bergmann, Chris Down, Helge Deller,
	Omar Sandoval, linux-kernel

From: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>

These two helper functions - virt_to_phys and isa_virt_to_bus - don't need the
address pointer to be mutable.

In the same time expecting it to be mutable leads to the following build
warning for constant pointers:

  warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ qualifier from pointer target type

Signed-off-by: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Ingo Molnar <mingo@redhat.com>
CC: Borislav Petkov <bp@alien8.de>
CC: Dave Hansen <dave.hansen@linux.intel.com>
CC: x86@kernel.org
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Geert Uytterhoeven <geert@linux-m68k.org>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Chris Down <chris@chrisdown.name>
CC: Helge Deller <deller@gmx.de>
CC: Omar Sandoval <osandov@fb.com>
CC: linux-kernel@vger.kernel.org
---
 arch/x86/include/asm/io.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index e9025640f634..0e6f5b48f517 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -128,7 +128,7 @@ extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);
  *	this function
  */
 
-static inline phys_addr_t virt_to_phys(volatile void *address)
+static inline phys_addr_t virt_to_phys(const volatile void *address)
 {
 	return __pa(address);
 }
@@ -163,7 +163,7 @@ static inline void *phys_to_virt(phys_addr_t address)
  * However, we truncate the address to unsigned int to avoid undesirable
  * promotions in legacy drivers.
  */
-static inline unsigned int isa_virt_to_bus(volatile void *address)
+static inline unsigned int isa_virt_to_bus(const volatile void *address)
 {
 	return (unsigned int)virt_to_phys(address);
 }



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/7] alpha: asm/io.h: Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes
  2023-04-15 11:17 [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes Stanislav Kinsburskii
  2023-04-15 11:17 ` [PATCH 1/7] x86: asm/io.h: " Stanislav Kinsburskii
@ 2023-04-15 11:17 ` Stanislav Kinsburskii
  2023-04-15 11:17 ` [PATCH 3/7] mips: asm/io.h: Expect immutable pointer in isa_virt_to_bus prototype Stanislav Kinsburskii
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Stanislav Kinsburskii @ 2023-04-15 11:17 UTC (permalink / raw)
  Cc: Stanislav Kinsburskii, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, Arnd Bergmann, Geert Uytterhoeven, Linus Walleij,
	Stanislav Kinsburskii, Michael Ellerman, Bjorn Helgaas,
	linux-alpha, linux-kernel

From: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>

These two helper functions - virt_to_phys and isa_virt_to_bus - don't need the
address pointer to be mutable.

In the same time expecting it to be mutable leads to the following build
warning for constant pointers:

  warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ qualifier from pointer target type

Signed-off-by: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
CC: Richard Henderson <richard.henderson@linaro.org>
CC: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
CC: Matt Turner <mattst88@gmail.com>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Geert Uytterhoeven <geert@linux-m68k.org>
CC: Linus Walleij <linus.walleij@linaro.org>
CC: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Bjorn Helgaas <bhelgaas@google.com>
CC: linux-alpha@vger.kernel.org
CC: linux-kernel@vger.kernel.org
---
 arch/alpha/include/asm/io.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h
index 7aeaf7c30a6f..0e2016537bd3 100644
--- a/arch/alpha/include/asm/io.h
+++ b/arch/alpha/include/asm/io.h
@@ -56,7 +56,7 @@ extern inline void set_hae(unsigned long new_hae)
  * Change virtual addresses to physical addresses and vv.
  */
 #ifdef USE_48_BIT_KSEG
-static inline unsigned long virt_to_phys(volatile void *address)
+static inline unsigned long virt_to_phys(const volatile void *address)
 {
 	return (unsigned long)address - IDENT_ADDR;
 }
@@ -66,7 +66,7 @@ static inline void * phys_to_virt(unsigned long address)
 	return (void *) (address + IDENT_ADDR);
 }
 #else
-static inline unsigned long virt_to_phys(volatile void *address)
+static inline unsigned long virt_to_phys(const volatile void *address)
 {
         unsigned long phys = (unsigned long)address;
 
@@ -104,7 +104,7 @@ static inline void * phys_to_virt(unsigned long address)
 extern unsigned long __direct_map_base;
 extern unsigned long __direct_map_size;
 
-static inline unsigned long __deprecated isa_virt_to_bus(volatile void *address)
+static inline unsigned long __deprecated isa_virt_to_bus(const volatile void *address)
 {
 	unsigned long phys = virt_to_phys(address);
 	unsigned long bus = phys + __direct_map_base;



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/7] mips: asm/io.h: Expect immutable pointer in isa_virt_to_bus prototype
  2023-04-15 11:17 [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes Stanislav Kinsburskii
  2023-04-15 11:17 ` [PATCH 1/7] x86: asm/io.h: " Stanislav Kinsburskii
  2023-04-15 11:17 ` [PATCH 2/7] alpha: " Stanislav Kinsburskii
@ 2023-04-15 11:17 ` Stanislav Kinsburskii
  2023-04-15 11:17 ` [PATCH 4/7] hexagon: asm/io.h: Expect immutable pointer in virt_to_phys prototype Stanislav Kinsburskii
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Stanislav Kinsburskii @ 2023-04-15 11:17 UTC (permalink / raw)
  Cc: Stanislav Kinsburskii, Thomas Bogendoerfer, Geert Uytterhoeven,
	Michael Ellerman, Florian Fainelli, Arnd Bergmann,
	Stanislav Kinsburskii, Jiaxun Yang, linux-mips, linux-kernel

From: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>

These helper function - isa_virt_to_bus - doesn't need the address pointer to
be mutable.

In the same time expecting it to be mutable leads to the following build
warning for constant pointers:

  warning: passing argument 1 of ‘isa_virt_to_bus’ discards ‘const’ qualifier from pointer target type

Signed-off-by: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
CC: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
CC: Geert Uytterhoeven <geert@linux-m68k.org>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Florian Fainelli <f.fainelli@gmail.com>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
CC: Jiaxun Yang <jiaxun.yang@flygoat.com>
CC: linux-mips@vger.kernel.org
CC: linux-kernel@vger.kernel.org
---
 arch/mips/include/asm/io.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
index cc28d207a061..d78ca2e71f8c 100644
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -137,7 +137,7 @@ static inline void * phys_to_virt(unsigned long address)
 /*
  * ISA I/O bus memory addresses are 1:1 with the physical address.
  */
-static inline unsigned long isa_virt_to_bus(volatile void *address)
+static inline unsigned long isa_virt_to_bus(const volatile void *address)
 {
 	return virt_to_phys(address);
 }



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/7] hexagon: asm/io.h: Expect immutable pointer in virt_to_phys prototype
  2023-04-15 11:17 [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes Stanislav Kinsburskii
                   ` (2 preceding siblings ...)
  2023-04-15 11:17 ` [PATCH 3/7] mips: asm/io.h: Expect immutable pointer in isa_virt_to_bus prototype Stanislav Kinsburskii
@ 2023-04-15 11:17 ` Stanislav Kinsburskii
  2023-04-15 11:17 ` [PATCH 5/7] ia64: " Stanislav Kinsburskii
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Stanislav Kinsburskii @ 2023-04-15 11:17 UTC (permalink / raw)
  Cc: Stanislav Kinsburskii, Brian Cain, Linus Walleij, Mark Brown,
	linux-hexagon, linux-kernel

From: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>

These helper function - virt_to_phys - doesn't need the address pointer to
be mutable.

In the same time expecting it to be mutable leads to the following build
warning for constant pointers:

  warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ qualifier from pointer target type

Signed-off-by: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
CC: Brian Cain <bcain@quicinc.com>
CC: Linus Walleij <linus.walleij@linaro.org>
CC: Mark Brown <broonie@kernel.org>
CC: linux-hexagon@vger.kernel.org
CC: linux-kernel@vger.kernel.org
---
 arch/hexagon/include/asm/io.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/hexagon/include/asm/io.h b/arch/hexagon/include/asm/io.h
index 46a099de85b7..facbd7467dd3 100644
--- a/arch/hexagon/include/asm/io.h
+++ b/arch/hexagon/include/asm/io.h
@@ -46,7 +46,7 @@ extern void __raw_writesl(void __iomem *addr, const void *data, int wordlen);
  * virt_to_phys - map virtual address to physical
  * @address:  address to map
  */
-static inline unsigned long virt_to_phys(volatile void *address)
+static inline unsigned long virt_to_phys(const volatile void *address)
 {
 	return __pa(address);
 }



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/7] ia64: asm/io.h: Expect immutable pointer in virt_to_phys prototype
  2023-04-15 11:17 [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes Stanislav Kinsburskii
                   ` (3 preceding siblings ...)
  2023-04-15 11:17 ` [PATCH 4/7] hexagon: asm/io.h: Expect immutable pointer in virt_to_phys prototype Stanislav Kinsburskii
@ 2023-04-15 11:17 ` Stanislav Kinsburskii
  2023-04-15 11:17 ` [PATCH 6/7] powerpc: " Stanislav Kinsburskii
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Stanislav Kinsburskii @ 2023-04-15 11:17 UTC (permalink / raw)
  Cc: Stanislav Kinsburskii, Geert Uytterhoeven, Helge Deller,
	Arnd Bergmann, Andrew Morton, Bjorn Helgaas,
	Stanislav Kinsburskii, linux-ia64, linux-kernel

From: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>

These helper function - virt_to_phys - doesn't need the address pointer to
be mutable.

In the same time expecting it to be mutable leads to the following build
warning for constant pointers:

  warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ qualifier from pointer target type

Signed-off-by: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
CC: Geert Uytterhoeven <geert@linux-m68k.org>
CC: Helge Deller <deller@gmx.de>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Bjorn Helgaas <bhelgaas@google.com>
CC: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
CC: linux-ia64@vger.kernel.org
CC: linux-kernel@vger.kernel.org
---
 arch/ia64/include/asm/io.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/ia64/include/asm/io.h b/arch/ia64/include/asm/io.h
index 83a492c8d298..c56ad21ba1e9 100644
--- a/arch/ia64/include/asm/io.h
+++ b/arch/ia64/include/asm/io.h
@@ -74,7 +74,7 @@ extern unsigned int num_io_spaces;
  * Change virtual addresses to physical addresses and vv.
  */
 static inline unsigned long
-virt_to_phys (volatile void *address)
+virt_to_phys (const volatile void *address)
 {
 	return (unsigned long) address - PAGE_OFFSET;
 }



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 6/7] powerpc: asm/io.h: Expect immutable pointer in virt_to_phys prototype
  2023-04-15 11:17 [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes Stanislav Kinsburskii
                   ` (4 preceding siblings ...)
  2023-04-15 11:17 ` [PATCH 5/7] ia64: " Stanislav Kinsburskii
@ 2023-04-15 11:17 ` Stanislav Kinsburskii
  2023-04-15 11:17 ` [PATCH 7/7] asm-generic/io.h: Expect immutable pointer in virt_to_phys Stanislav Kinsburskii
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Stanislav Kinsburskii @ 2023-04-15 11:17 UTC (permalink / raw)
  Cc: Stanislav Kinsburskii, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, Geert Uytterhoeven, Bjorn Helgaas,
	Stanislav Kinsburskii, Arnd Bergmann, linuxppc-dev, linux-kernel

From: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>

These helper function - virt_to_phys - doesn't need the address pointer to
be mutable.

In the same time expecting it to be mutable leads to the following build
warning for constant pointers:

  warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ qualifier from pointer target type

Signed-off-by: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Nicholas Piggin <npiggin@gmail.com>
CC: Christophe Leroy <christophe.leroy@csgroup.eu>
CC: Geert Uytterhoeven <geert@linux-m68k.org>
CC: Bjorn Helgaas <bhelgaas@google.com>
CC: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
CC: Arnd Bergmann <arnd@arndb.de>
CC: linuxppc-dev@lists.ozlabs.org
CC: linux-kernel@vger.kernel.org
---
 arch/powerpc/include/asm/io.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index f1e657c9bbe8..c287eeb9536f 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -959,7 +959,7 @@ extern void __iomem *__ioremap_caller(phys_addr_t, unsigned long size,
  *	almost all conceivable cases a device driver should not be using
  *	this function
  */
-static inline unsigned long virt_to_phys(volatile void * address)
+static inline unsigned long virt_to_phys(const volatile void * address)
 {
 	WARN_ON(IS_ENABLED(CONFIG_DEBUG_VIRTUAL) && !virt_addr_valid(address));
 



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 7/7] asm-generic/io.h: Expect immutable pointer in virt_to_phys
  2023-04-15 11:17 [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes Stanislav Kinsburskii
                   ` (5 preceding siblings ...)
  2023-04-15 11:17 ` [PATCH 6/7] powerpc: " Stanislav Kinsburskii
@ 2023-04-15 11:17 ` Stanislav Kinsburskii
  2023-08-25  8:38   ` Linus Walleij
  2023-04-28  7:40 ` [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes Arnd Bergmann
  2023-05-03  7:32 ` Linus Walleij
  8 siblings, 1 reply; 12+ messages in thread
From: Stanislav Kinsburskii @ 2023-04-15 11:17 UTC (permalink / raw)
  Cc: Stanislav Kinsburskii, Arnd Bergmann, linux-arch, linux-kernel

From: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>

These helper function - virt_to_phys - doesn't need the address pointer to be
mutable.

In the same time expecting it to be mutable leads to the following build
warning for constant pointers:

  warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ qualifier from pointer target type

Signed-off-by: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
CC: Arnd Bergmann <arnd@arndb.de>
CC: linux-arch@vger.kernel.org
CC: linux-kernel@vger.kernel.org
---
 include/asm-generic/io.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 587e7e9b9a37..ee9d9584e05b 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -1000,7 +1000,7 @@ static inline void iowrite64_rep(volatile void __iomem *addr,
  */
 #ifndef virt_to_phys
 #define virt_to_phys virt_to_phys
-static inline unsigned long virt_to_phys(volatile void *address)
+static inline unsigned long virt_to_phys(const volatile void *address)
 {
 	return __pa((unsigned long)address);
 }



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes
  2023-04-15 11:17 [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes Stanislav Kinsburskii
                   ` (6 preceding siblings ...)
  2023-04-15 11:17 ` [PATCH 7/7] asm-generic/io.h: Expect immutable pointer in virt_to_phys Stanislav Kinsburskii
@ 2023-04-28  7:40 ` Arnd Bergmann
  2023-05-03  7:32 ` Linus Walleij
  8 siblings, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2023-04-28  7:40 UTC (permalink / raw)
  To: Stanislav Kinsburskii
  Cc: Matt Turner, x86, Stanislav Kinsburskii, Borislav Petkov,
	linux-ia64, Mark Brown, Richard Henderson, linux-kernel,
	Brian Cain, linux-mips, Geert Uytterhoeven, linux-alpha,
	Linux-Arch, Michael Ellerman, Linus Walleij, Jiaxun Yang,
	Bjorn Helgaas, Andrew Morton, Dave Hansen, Omar Sandoval,
	Helge Deller, linuxppc-dev, linux-hexagon, Thomas Bogendoerfer,
	Ivan Kokshaysky, Ingo Molnar, Florian Fainelli, Chris Down,
	Nicholas Piggin, Christophe Leroy, H. Peter Anvin,
	Thomas Gleixner

On Sat, Apr 15, 2023, at 12:17, Stanislav Kinsburskii wrote:
> This series is aimed to address compilation warnings when a constant pointer
> is passed to virt_to_phys and isa_virt_to_bus functions:
>
>   warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ 
> qualifier from pointer target type
>   warning: passing argument 1 of ‘isa_virt_to_bus’ discards ‘const’ 
> qualifier from pointer target type
>
> The change(s) is the same for all architectures, but it's split into a series on
> per-arch basis to simplify applying and testing on the maintainers side.
>

Looks all good to me. If everyone is happy with it, I'll queue it up
after in the asm-generic tree for 6.5, once rc1 is out.

 Arnd

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes
  2023-04-15 11:17 [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes Stanislav Kinsburskii
                   ` (7 preceding siblings ...)
  2023-04-28  7:40 ` [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes Arnd Bergmann
@ 2023-05-03  7:32 ` Linus Walleij
  8 siblings, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2023-05-03  7:32 UTC (permalink / raw)
  To: Stanislav Kinsburskii
  Cc: Matt Turner, x86, Stanislav Kinsburskii, Borislav Petkov,
	linux-ia64, Mark Brown, Richard Henderson, linux-kernel,
	Brian Cain, linux-mips, Geert Uytterhoeven, linux-alpha,
	linux-arch, Michael Ellerman, Jiaxun Yang, Bjorn Helgaas,
	Andrew Morton, Dave Hansen, Omar Sandoval, Helge Deller,
	linuxppc-dev, linux-hexagon, Thomas Bogendoerfer, Ivan Kokshaysky,
	Ingo Molnar, Arnd Bergmann, Florian Fainelli, Chris Down,
	Nicholas Piggin, Christophe Leroy, H. Peter Anvin,
	Thomas Gleixner

On Thu, Apr 27, 2023 at 7:41 PM Stanislav Kinsburskii
<skinsburskii@linux.microsoft.com> wrote:

> This series is aimed to address compilation warnings when a constant pointer
> is passed to virt_to_phys and isa_virt_to_bus functions:
>
>   warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ qualifier from pointer target type
>   warning: passing argument 1 of ‘isa_virt_to_bus’ discards ‘const’ qualifier from pointer target type
>
> The change(s) is the same for all architectures, but it's split into a series on
> per-arch basis to simplify applying and testing on the maintainers side.
>
> The following series implements...

This is nice.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

I am working with an adjacent task, which is to make virt_to_pfn() and
pfn_to_virt() into static inlines. I might need to rebase my work on top
of this but it should be doable, I am currently stressing the buildbots
with this with the idea to propose it to Arnd once v6.4-rc1 is out:
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git/log/?h=b4/virt-to-pfn-v6-4-rc1

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 7/7] asm-generic/io.h: Expect immutable pointer in virt_to_phys
  2023-04-15 11:17 ` [PATCH 7/7] asm-generic/io.h: Expect immutable pointer in virt_to_phys Stanislav Kinsburskii
@ 2023-08-25  8:38   ` Linus Walleij
  0 siblings, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2023-08-25  8:38 UTC (permalink / raw)
  To: Stanislav Kinsburskii
  Cc: Stanislav Kinsburskii, Arnd Bergmann, linux-arch, linux-kernel

On Thu, Apr 27, 2023 at 7:43 PM Stanislav Kinsburskii
<skinsburskii@linux.microsoft.com> wrote:

> From: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
>
> These helper function - virt_to_phys - doesn't need the address pointer to be
> mutable.
>
> In the same time expecting it to be mutable leads to the following build
> warning for constant pointers:
>
>   warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ qualifier from pointer target type
>
> Signed-off-by: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
> CC: Arnd Bergmann <arnd@arndb.de>
> CC: linux-arch@vger.kernel.org
> CC: linux-kernel@vger.kernel.org

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

I changed several other virt_to_phys() implementations to add const to
the argument and no problems so this should work fine.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/7] x86: asm/io.h: Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes
  2023-04-15 11:17 ` [PATCH 1/7] x86: asm/io.h: " Stanislav Kinsburskii
@ 2023-08-25  8:39   ` Linus Walleij
  0 siblings, 0 replies; 12+ messages in thread
From: Linus Walleij @ 2023-08-25  8:39 UTC (permalink / raw)
  To: Stanislav Kinsburskii
  Cc: Stanislav Kinsburskii, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
	Geert Uytterhoeven, Arnd Bergmann, Chris Down, Helge Deller,
	Omar Sandoval, linux-kernel

On Thu, Apr 27, 2023 at 7:42 PM Stanislav Kinsburskii
<skinsburskii@linux.microsoft.com> wrote:

> From: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
>
> These two helper functions - virt_to_phys and isa_virt_to_bus - don't need the
> address pointer to be mutable.
>
> In the same time expecting it to be mutable leads to the following build
> warning for constant pointers:
>
>   warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ qualifier from pointer target type
>
> Signed-off-by: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
> CC: Thomas Gleixner <tglx@linutronix.de>
> CC: Ingo Molnar <mingo@redhat.com>
> CC: Borislav Petkov <bp@alien8.de>
> CC: Dave Hansen <dave.hansen@linux.intel.com>
> CC: x86@kernel.org
> CC: "H. Peter Anvin" <hpa@zytor.com>
> CC: Geert Uytterhoeven <geert@linux-m68k.org>
> CC: Arnd Bergmann <arnd@arndb.de>
> CC: Chris Down <chris@chrisdown.name>
> CC: Helge Deller <deller@gmx.de>
> CC: Omar Sandoval <osandov@fb.com>
> CC: linux-kernel@vger.kernel.org

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

This is the right thing to do.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-08-25  8:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-15 11:17 [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes Stanislav Kinsburskii
2023-04-15 11:17 ` [PATCH 1/7] x86: asm/io.h: " Stanislav Kinsburskii
2023-08-25  8:39   ` Linus Walleij
2023-04-15 11:17 ` [PATCH 2/7] alpha: " Stanislav Kinsburskii
2023-04-15 11:17 ` [PATCH 3/7] mips: asm/io.h: Expect immutable pointer in isa_virt_to_bus prototype Stanislav Kinsburskii
2023-04-15 11:17 ` [PATCH 4/7] hexagon: asm/io.h: Expect immutable pointer in virt_to_phys prototype Stanislav Kinsburskii
2023-04-15 11:17 ` [PATCH 5/7] ia64: " Stanislav Kinsburskii
2023-04-15 11:17 ` [PATCH 6/7] powerpc: " Stanislav Kinsburskii
2023-04-15 11:17 ` [PATCH 7/7] asm-generic/io.h: Expect immutable pointer in virt_to_phys Stanislav Kinsburskii
2023-08-25  8:38   ` Linus Walleij
2023-04-28  7:40 ` [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes Arnd Bergmann
2023-05-03  7:32 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox