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

Re: [PATCH 1/2] rangeset: add RANGESETF_no_print flag


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Tue, 23 Nov 2021 08:04:02 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=WEmr4y0KxL+qd031VVKDNsaTVf0BU43exO5qqZFOFOE=; b=aY/H3aDwDOS3SP74e0hA3k1RkSvpypPvPP7kVnz9rQvZO2Uh7rAjaVlBY8+m4Bsx8sC0VeIyEmenggglqTMzjtDPTCEHewYzzU9I4vWCH8ExFcW0V6eP5TR8MlSfKKZD296P7KMvXyQS6+Sx5S9OBJoGpzpNAkx2mNsXJTxYvomWFC1VTqj95nSoZh7k0/SF6wtSPs0yZ0YtIP/eUnvYoeveEJVMIFuj/UvXuk7Y94FViuRZqaINng3CRYnk9RkSRiZoesHVoozbVv7bANnE1cSTpZCE0T1E20FjLv1XplfwpGin7yJDMmrRpFragdmDN/iomDz649QtrRv2lUiRgg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lKeFOrHN/KEZDM1rb+dWnxmzw6umY/28iLxxCAQeILXM17D6tZTsMdWev+9+IaJE9go0QOZkEe+a5yaGcD1MpF0JyjbuV1uItXam8Aype1D3fVi5DLlSUgHfK9XmRJM9qNQGE2iN8J1ijCc20pr3uNZ6zbjplFIXPtI6Wz+gQw/BsrKq8aiGG0N0t6BHqEYxgtMKDnglpy7gQXlrcZ2ku49e+Fey/INedayyb9J7SreNo05f6zf7IrphUecn6V/Sh8lqx9NPb1rI+5nBuirZsQ3VFPI30QAlw2jOaJg9spctnyNAu/TxGhwHfLiycxSwJvTVkvM1+gYMCT/g8R10sQ==
  • Cc: "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Delivery-date: Tue, 23 Nov 2021 08:04:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHX34NQb/OdxzJcEUqRnDxd7565ZKwQu1AAgAADEACAAAMogIAAAMqA
  • Thread-topic: [PATCH 1/2] rangeset: add RANGESETF_no_print flag


On 23.11.21 10:01, Jan Beulich wrote:
> On 23.11.2021 08:49, Oleksandr Andrushchenko wrote:
>>
>> On 23.11.21 09:38, Jan Beulich wrote:
>>> On 22.11.2021 10:28, Oleksandr Andrushchenko wrote:
>>>> --- a/xen/include/xen/rangeset.h
>>>> +++ b/xen/include/xen/rangeset.h
>>>> @@ -51,6 +51,9 @@ void rangeset_limit(
>>>>     /* Pretty-print range limits in hexadecimal. */
>>>>    #define _RANGESETF_prettyprint_hex 0
>>>>    #define RANGESETF_prettyprint_hex  (1U << _RANGESETF_prettyprint_hex)
>>>> +/* Do not print entries marked with this flag. */
>>>> +#define _RANGESETF_no_print 1
>>> There's no need for this, so I'd like to ask that you add ...
>>>
>>>> +#define RANGESETF_no_print  (1U << _RANGESETF_no_print)
>>> ... just this. In due course we should do away with
>>> _RANGESETF_prettyprint_hex as well (unless you want to do so right
>>> at this occasion).
>> Ok, I can remove "#define _RANGESETF_prettyprint_hex 0" as well
>> and have both flags defined as
>>    /* Pretty-print range limits in hexadecimal. */
>> #define RANGESETF_prettyprint_hex  (1U << 0)
>> /* Do not print entries marked with this flag. */
>> #define RANGESETF_no_print         (1U << 1)
>>
>> Or we can use BIT macro here:
>>
>> /* Pretty-print range limits in hexadecimal. */
>> #define RANGESETF_prettyprint_hex  BIT(0, U)
>> /* Do not print entries marked with this flag. */
>> #define RANGESETF_no_print         BIT(1, U)
>>
>> What's your preference here?
> Clearly the former.
I am fine with this too, so I'll use it
>   But this may not be everybody's view. I'm hesitant
> towards further uses at least as long as its generalization, GENMASK(),
> isn't ready for easy use. It was some time ago that we had a discussion
> about that one, supporting my reservations voiced back at the time when
> it was introduced into our code base. Iirc there was more than one
> issue with it; the immediately obvious one is that it silently does the
> wrong thing when the arguments get specified the wrong way round, when
> it really would be relatively easy to support either ordering.
>
> Jan
>
Thank you,
Oleksandr

 


Rackspace

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