[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 5/6] tools: Use new byteswap helper


  • To: Lin Liu (刘林) <lin.liu@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 24 May 2022 08:10:44 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tn4hMaJcCrqE7Eqs0AynlLT1KQMGQksU5uGKvluQd6k=; b=JZLdPjNzpgyaqKeg8DTg5J7RSBQ8PKLVwBOxZ7uEbQjCf871/IquIHDiuK/bR39PC0XT8E4oGixmUI6ii8f8zS9jcYtBzadWWii6v/OS6n+us5iEiYhyoi5t9Y6pdhqrSyGp/0Xi8kHiMWzM4eV7Cgbwnl7qWVzMqOPTf5RPquvLBh8Zz5VLmNyKgRQl/k9bwEtBE0pZ41iQVz7+duUnU8ASCDOGVaj7LoEHtCoX1eXmpS9hBmQhVq1G8V+hLdEUfuhWuKh1V22f/ZqY6vAfXF77XkVf5wNq+LPnjUcl+QHKkC/mcH10p4t3zLU5+BmU4dNlI9RcX0gMQuv+x+onDw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SaqDKiA2sPpaCaFeWaVXkZ49ol+RWUsL8Hs3Sn5hvHBgm56SdDubJrhGm4n9WK6ysUSNEpxUiXxz7HFFZyCe76JrqYuzhvPBEQEGwwMPvu8RxYgyMwqeLo1RcnbHHsAXzZ11gouhl9dg68wrwn184A4oEqpAJppGF/DjTEmckFPevyhEGJMPwcbkSBQmgFFpsLc2Sdbop6faNffKYuKoMz2aWyZrM4/997vYMISyFrXVwB5hc2m61vWiy1pO/4XQVdhT+h9XQ4k2hfLVvg6hTeaZGQXs2yLP28bD+lmaIB9YiN6BHLqPeQtvIO4POHmQGZUnR0bjNxx0AKspuDfrsg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 24 May 2022 07:42:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24.05.2022 04:13, Lin Liu (刘林) wrote:
> 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.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.