[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <7d0389aa-4fc0-499b-8f2e-5a96102efa24@app.fastmail.com>
Date: Sat, 22 Apr 2023 11:02:33 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Stanislav Kinsburskii" <skinsburskii@...ux.microsoft.com>
Cc: "Stanislav Kinsburskii" <stanislav.kinsburskii@...il.com>,
"Thomas Gleixner" <tglx@...utronix.de>,
"Ingo Molnar" <mingo@...hat.com>, "Borislav Petkov" <bp@...en8.de>,
"Dave Hansen" <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
"Geert Uytterhoeven" <geert@...ux-m68k.org>,
"Chris Down" <chris@...isdown.name>,
"Helge Deller" <deller@....de>, "Omar Sandoval" <osandov@...com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86: asm/io.h: Harden virt_to_phys/isa_virt_to_bus prototypes
On Fri, Apr 14, 2023, at 11:40, Stanislav Kinsburskii wrote:
> From: Stanislav Kinsburskii <stanislav.kinsburskii@...il.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
>
The change looks fine, and this is clearly useful for spreading
more 'const' annotations, but I have two concerns:
- I'd really like this to be done consistently across architectures,
so at least the asm-generic/io.h version should get the same
annotation, or ideally all of them in one patch.
- I would not describe this change itself as "hardening", as it
also does the opposite, when you have a pointer that is actually
"const" but converting it through virt_to_phys() and back
through phys_to_virt() ends up losing the annotation.
Arnd
Powered by blists - more mailing lists