All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] earlycpio: constify find_cpio_data()'s "data" parameter
Date: Mon, 28 Oct 2024 17:25:12 +0100	[thread overview]
Message-ID: <aab91022-5115-4af0-8f9d-569c63a296bb@suse.com> (raw)
In-Reply-To: <ecd11958-2ce8-41fc-87f8-7b6b090c74b5@citrix.com>

On 28.10.2024 17:18, Andrew Cooper wrote:
> On 28/10/2024 4:12 pm, Jan Beulich wrote:
>> On 28.10.2024 17:07, Andrew Cooper wrote:
>>> On 28/10/2024 4:03 pm, Jan Beulich wrote:
>>>> As with 9cbf61445cda ("xen/earlycpio: Drop nextoff parameter"): While
>>>> this is imported from Linux, the parameter not being pointer-to-const is
>>>> dubious in the first place and we're not plausibly going to gain a write
>>>> through it.
>>>>
>>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>> You haven't tried compiling this, have you?
>> Of course I have. Is there any subtlety with compiler versions? Or what
>> else am I missing?
> 
> struct cpio_data's copy of this field is non-const (which you keep on
> noting that new compilers will object to),

New compilers? I'm afraid I'm missing context. With gcc14 the patch builds
fine. I didn't try _older_ ones (but I see no reason why they might object;
see below).

> and you can't change that
> without breaking the build in microcode.

I don't need to change that, "thanks" to

			cd.data = (void *)dptr;

casting away const-ness. That is - compilers ought to be fine with the
change; Misra won't like it.

> Nothing of this form can be taken until the constness is consistent in
> microcode, after which yes it can mostly become const.

We can move there in steps, can't we?

Jan


  reply	other threads:[~2024-10-28 16:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28 16:03 [PATCH] earlycpio: constify find_cpio_data()'s "data" parameter Jan Beulich
2024-10-28 16:07 ` Andrew Cooper
2024-10-28 16:12   ` Jan Beulich
2024-10-28 16:18     ` Andrew Cooper
2024-10-28 16:25       ` Jan Beulich [this message]
2024-10-28 16:45         ` Andrew Cooper
2024-10-28 16:51           ` Jan Beulich
2024-10-28 17:07             ` Frediano Ziglio

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=aab91022-5115-4af0-8f9d-569c63a296bb@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.