linuxppc-dev.lists.ozlabs.org archive mirror
 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 6/7] powerpc: asm/io.h: Expect immutable pointer in virt_to_phys prototype Stanislav Kinsburskii
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Stanislav Kinsburskii @ 2023-04-15 11:17 UTC (permalink / raw)
  Cc: linux-ia64, Linus Walleij, Dave Hansen, Jiaxun Yang, linux-mips,
	H. Peter Anvin, linux-hexagon, Omar Sandoval, linux-arch,
	Florian Fainelli, Helge Deller, x86, Stanislav Kinsburskii,
	Ingo Molnar, Geert Uytterhoeven, Matt Turner, Arnd Bergmann,
	Richard Henderson, Nicholas Piggin, Mark Brown, Borislav Petkov,
	Bjorn Helgaas, Thomas Gleixner, Brian Cain, Thomas Bogendoerfer,
	Chris Down, linux-kernel, linux-alpha, Iva n Kokshaysky,
	Andrew Morton, linuxppc-dev

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] 6+ 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
@ 2023-04-15 11:17 ` Stanislav Kinsburskii
  2023-04-28  7:40 ` [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes Arnd Bergmann
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Stanislav Kinsburskii @ 2023-04-15 11:17 UTC (permalink / raw)
  Cc: Arnd Bergmann, linux-kernel, Stanislav Kinsburskii,
	Geert Uytterhoeven, Nicholas Piggin, Bjorn Helgaas, linuxppc-dev

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] 6+ 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
  2023-04-15 11:17 ` [PATCH 6/7] powerpc: asm/io.h: Expect immutable pointer in virt_to_phys prototype Stanislav Kinsburskii
@ 2023-04-28  7:40 ` Arnd Bergmann
  2023-08-22 21:26   ` Stanislav Kinsburskii
  2023-05-03  7:32 ` Linus Walleij
  2023-10-27  9:59 ` Michael Ellerman
  3 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2023-04-28  7:40 UTC (permalink / raw)
  To: Stanislav Kinsburskii
  Cc: linux-ia64, Linus Walleij, Dave Hansen, Jiaxun Yang, linux-mips,
	H. Peter Anvin, linux-hexagon, Omar Sandoval, Linux-Arch,
	Florian Fainelli, Helge Deller, x86, Stanislav Kinsburskii,
	Ingo Molnar, Geert Uytterhoeven, Matt Turner, Richard Henderson,
	Nicholas Piggin, Mark Brown, Borislav Petkov, Bjorn Helgaas,
	Thomas Gleixner, Brian Cain, Thomas Bogendoerfer, Chris Down,
	linux-kernel, linux-alpha, Ivan Kokshaysky, Andrew Morton,
	linuxppc-dev

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] 6+ 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
  2023-04-15 11:17 ` [PATCH 6/7] powerpc: asm/io.h: Expect immutable pointer in virt_to_phys prototype Stanislav Kinsburskii
  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
  2023-10-27  9:59 ` Michael Ellerman
  3 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2023-05-03  7:32 UTC (permalink / raw)
  To: Stanislav Kinsburskii
  Cc: linux-ia64, Dave Hansen, Jiaxun Yang, linux-mips, H. Peter Anvin,
	Omar Sandoval, linux-arch, Florian Fainelli, Helge Deller, x86,
	Stanislav Kinsburskii, Ingo Molnar, Geert Uytterhoeven,
	Matt Turner, Arnd Bergmann, linux-alpha, Richard Henderson,
	Nicholas Piggin, Mark Brown, Borislav Petkov, Bjorn Helgaas,
	Thomas Gleixner, Brian Cain, Thomas Bogendoerfer, Chris Down,
	linux-kernel, linux-hexagon, Ivan Kokshaysky, A ndrew Morton,
	linuxppc-dev

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] 6+ messages in thread

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

On Fri, Apr 28, 2023 at 08:40:51AM +0100, Arnd Bergmann wrote:
> 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.
> 

Hello Arnd,
Is the plan to merge this series into 6.5 still on?

Stanislav

>  Arnd

^ permalink raw reply	[flat|nested] 6+ 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
                   ` (2 preceding siblings ...)
  2023-05-03  7:32 ` Linus Walleij
@ 2023-10-27  9:59 ` Michael Ellerman
  3 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2023-10-27  9:59 UTC (permalink / raw)
  To: Stanislav Kinsburskii; +Cc: linuxppc-dev

On Sat, 15 Apr 2023 04:17:19 -0700, 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.
> 
> [...]

Patch 6 applied to powerpc/next.

[6/7] powerpc: asm/io.h: Expect immutable pointer in virt_to_phys prototype
      https://git.kernel.org/powerpc/c/b28d1ccf921a4333be14017d82066386d419e638

cheers

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

end of thread, other threads:[~2023-10-27 10:24 UTC | newest]

Thread overview: 6+ 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 6/7] powerpc: asm/io.h: Expect immutable pointer in virt_to_phys prototype Stanislav Kinsburskii
2023-04-28  7:40 ` [PATCH 0/7] Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes Arnd Bergmann
2023-08-22 21:26   ` Stanislav Kinsburskii
2023-05-03  7:32 ` Linus Walleij
2023-10-27  9:59 ` Michael Ellerman

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