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>,
	"Anthony PERARD" <anthony.perard@vates.tech>,
	"Michal Orzel" <michal.orzel@amd.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Stefano Stabellini" <stefano.stabellini@amd.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v5] xen: simplify bitmap_to_xenctl_bitmap for little endian
Date: Wed, 2 Apr 2025 11:30:22 +0200	[thread overview]
Message-ID: <52ae7bed-ba15-4842-b5d8-4fcb61df28b2@suse.com> (raw)
In-Reply-To: <87f8fc5f-ed82-4930-bc04-50106cc5acff@citrix.com>

On 02.04.2025 11:21, Andrew Cooper wrote:
> On 01/04/2025 11:09 am, Jan Beulich wrote:
>> --- a/xen/common/bitmap.c
>> +++ b/xen/common/bitmap.c
>> @@ -359,12 +343,11 @@ static void bitmap_byte_to_long(unsigned
>>  
>>  #elif defined(__LITTLE_ENDIAN)
>>  
>> -static void bitmap_long_to_byte(uint8_t *bp, const unsigned long *lp,
>> -				unsigned int nbits)
>> -{
>> -	memcpy(bp, lp, DIV_ROUND_UP(nbits, BITS_PER_BYTE));
>> -	clamp_last_byte(bp, nbits);
>> -}
>> +#define LITTLE_ENDIAN 1 /* For IS_ENABLED(). */
> 
> I guess I can fix this in my bswap series by giving __LITTLE_ENDIAN the
> value of 1 when it is defined ?

Hmm, that's an option, yes. Yet then I didn't pay close enough attention
to that part of the respective patch in that series, as I was blindly
assuming it to instead be

#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
# define __LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
# define __BIG_ENDIAN __ORDER_BIG_ENDIAN__
#endif

to keep the values of the symbols unaltered.

> Otherwise, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks.

Jan


  reply	other threads:[~2025-04-02  9:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01  0:50 [PATCH v4] xen: simplify bitmap_to_xenctl_bitmap for little endian Stefano Stabellini
2025-04-01 10:09 ` [PATCH v5] " Jan Beulich
2025-04-02  0:14   ` Stefano Stabellini
2025-04-02  9:18     ` Jan Beulich
2025-04-02  9:21   ` Andrew Cooper
2025-04-02  9:30     ` Jan Beulich [this message]
2025-04-02  9:36       ` Andrew Cooper
2025-04-02  9:42         ` Jan Beulich

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=52ae7bed-ba15-4842-b5d8-4fcb61df28b2@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=stefano.stabellini@amd.com \
    --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.