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

Re: [PATCH 2/2] xen: Change parameter of generic_fls() to unsigned int


  • To: Michal Orzel <michal.orzel@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 4 Sep 2023 15:28:02 +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=zLZSnbVwolq8C8JlcoJNQrrEjOAt23yMtT6/TJutg4E=; b=ZKt/3pwNhun/2CEpyiOhp9emWCJD4+drzJVbuvuzrEEeXWxLZW0esw+asQrJ+p/bD9Gmw0rqX837pKU5dLDe045rqtdvZOXI7sWSyjCZ6QUcKWMeXo2OsMWUISFTG15NDj/QWhZ9LsU0yJUVx4l1vfgoF8ygAyvMupp9CGcENTXFCNkFUFbpyhKXgkVxl+3Rs9hWL717PI5JRR3yFytmY5oHLicz3iolxI45GMGPqz2QBs09D4jmGP3eGmOjrVVYvd85uV1iuPhHjFKnNZTCGVGRffMFN/RMFib0QPxYIsglruf++s4WwXGYCuqGmy9Fb2pyQijDWheRNUlE0vFs9Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M5UUdSQ/ksW/sesBg0bfUaLiEpasugniYBg/GDEfQQSvelPIYrKi97bzg/knwaVKNMHRiI9JSRmxg5LsBvtmlvyheO10rgmincI8G6Z5iwF+4bojqXufko3O/WqvWNRb0izgLOnWhEnJ4pCQaXrbqN9H8L7I7bLM9xQHltGX9UZiJavG899wVGkvG+nC6qd/xCFaBiddm4odcClhp3OVKUB307oymC/vsxi6GOCFwPwazqD+RoaqSGwirVfy38YBoR7dC2KWtucvoZRZhWxcA0ggpLk8yRu4hIo9W78a059kYKwJECIEnd2/cRAK5QXPo1anbWcu5Hi8zwmpfQOj9Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 04 Sep 2023 13:28:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04.09.2023 11:14, Michal Orzel wrote:
> --- a/xen/include/xen/bitops.h
> +++ b/xen/include/xen/bitops.h
> @@ -51,7 +51,7 @@ static inline int generic_ffs(int x)
>   * fls: find last bit set.
>   */
>  
> -static __inline__ int generic_fls(int x)
> +static __inline__ int generic_fls(unsigned int x)
>  {
>      int r = 32;
>  

Even if perhaps not affected by UBSAN, generic_ffs() then wants taking care
of as well, imo. If additionally you switch __inline__ to inline, things
will become nicely symmetric with generic_f{f,l}sl().

Another aspect that may be nice to take care of at this occasion is their
return values: None of them can return negative values, so return type
would better be unsigned int.

Jan



 


Rackspace

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