mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Stanislav Kinsburskii" <skinsburskii@linux.microsoft.com>
Cc: "Stanislav Kinsburskii" <stanislav.kinsburskii@gmail.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Chris Down" <chris@chrisdown.name>,
	"Helge Deller" <deller@gmx.de>, "Omar Sandoval" <osandov@fb.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: asm/io.h: Harden virt_to_phys/isa_virt_to_bus prototypes
Date: Sat, 22 Apr 2023 11:02:33 +0200	[thread overview]
Message-ID: <7d0389aa-4fc0-499b-8f2e-5a96102efa24@app.fastmail.com> (raw)
In-Reply-To: <168146523405.6279.3632248068235163346.stgit@skinsburskii.localdomain>

On Fri, Apr 14, 2023, at 11:40, Stanislav Kinsburskii 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
>

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

  reply	other threads:[~2023-04-22  9:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14  9:40 Stanislav Kinsburskii
2023-04-22  9:02 ` Arnd Bergmann [this message]
2023-04-15  3:23   ` Stanislav Kinsburskii

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=7d0389aa-4fc0-499b-8f2e-5a96102efa24@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=chris@chrisdown.name \
    --cc=dave.hansen@linux.intel.com \
    --cc=deller@gmx.de \
    --cc=geert@linux-m68k.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=osandov@fb.com \
    --cc=skinsburskii@linux.microsoft.com \
    --cc=stanislav.kinsburskii@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®