All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lin Liu (刘林)" <lin.liu@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Wei Liu <wl@xen.org>, Anthony Perard <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v4 5/6] tools: Use new byteswap helper
Date: Tue, 24 May 2022 07:17:29 +0000	[thread overview]
Message-ID: <SJ0PR03MB540542A4BCB2496BD1F49A769DD79@SJ0PR03MB5405.namprd03.prod.outlook.com> (raw)
In-Reply-To: <75055009-5053-0d4f-9174-3dd69add7c8a@suse.com>

[-- Attachment #1: Type: text/plain, Size: 1798 bytes --]

>>>> On 23.05.2022 11:52, Lin Liu wrote:
>>>>>> --- a/tools/libs/guest/xg_dom_decompress_unsafe_xz.c
>>>>>> +++ b/tools/libs/guest/xg_dom_decompress_unsafe_xz.c
>>>>>> @@ -34,6 +34,11 @@ static inline u32 le32_to_cpup(const u32 *p)
>>>>>>        return cpu_to_le32(*p);
>>>>>>  }
>>>>>>
>>>>>> +static inline u32 le32_to_cpu(u32 val)
>>>>>> +{
>>>>>> +   return le32_to_cpup((const u32 *)&val);
>>>>>> +}
>>>>>
>>>>> Why the cast? And why not uint32_t?
>>>>>
>>>>> Jan
>>>>
>>>> le32_to_cpup has following prototye and definition
>>>>
>>>> static inline u32 le32_to_cpup(const u32 *p)
>>>> {
>>>>         return cpu_to_le32(*p);
>>>> }
>>>>
>>>> xg_dom_decompress_unsafe_xz.c redefine and use u32, use u32 to keep consistent
>>>> typedef uint32_t u32;
>>>
>>> This answers neither part of my question. For u32 vs uint32_t, please
>>> also see ./CODING_STYLE.
>>
>> Type cast is unnecessary, will be removed in next version of patch
>> CODING_STYLE encourage uint32_t instead of u32,
>> However, Current xg_dom_decompress_unsafe_xz.c already use u32 instead of unit32_t, so I
>> use u32 to keep censistent, otherwise, the code look strange
>
>Strange or not, that's the only way to phase out certain things without
>using gigantic patches / series touching the entire tree at one time.
>New code should not use these deprecated (for our purposes) types
>anymore. Note how the file you adjust here already has to introduce
>these type aliases for things to build. These typedefs really want to
>go away, and any new use of those types is another hindrance in doing

well, you convinced me to use uint32_t instead of u32.
However, This patch will not update other u32(s) to get focus.
I can raise another patch to update parts if necessary.

Cheers,
Lin

[-- Attachment #2: Type: text/html, Size: 7146 bytes --]

  reply	other threads:[~2022-05-24  7:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-23  9:52 [PATCH v4 0/6] Implement byteswap and update references Lin Liu
2022-05-23  9:52 ` [PATCH v4 1/6] xen: implement byteswap Lin Liu
2022-05-23 10:07   ` Roger Pau Monné
2022-05-23 11:00     ` Jan Beulich
2022-05-23 11:05       ` Jan Beulich
2022-05-23  9:52 ` [PATCH v4 2/6] crypto/vmac: Simplify code with byteswap Lin Liu
2022-05-23  9:52 ` [PATCH v4 3/6] arm64/find_next_bit: Remove ext2_swab() Lin Liu
2022-05-23 10:10   ` Julien Grall
2022-05-23  9:52 ` [PATCH v4 4/6] xen: Switch to byteswap Lin Liu
2022-05-23 10:12   ` Julien Grall
2022-05-23 11:09     ` Jan Beulich
2022-05-23  9:52 ` [PATCH v4 5/6] tools: Use new byteswap helper Lin Liu
2022-05-23 11:10   ` Jan Beulich
2022-05-24  2:13     ` Lin Liu (刘林)
2022-05-24  6:10       ` Jan Beulich
2022-05-24  6:52         ` Lin Liu (刘林)
2022-05-24  6:58           ` Jan Beulich
2022-05-24  7:17             ` Lin Liu (刘林) [this message]
2022-05-24  8:52               ` Jan Beulich
2022-05-23  9:52 ` [PATCH v4 6/6] byteorder: Remove byteorder Lin Liu

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=SJ0PR03MB540542A4BCB2496BD1F49A769DD79@SJ0PR03MB5405.namprd03.prod.outlook.com \
    --to=lin.liu@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=wl@xen.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.