lkml.org 
[lkml]   [2022]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/8] lib/bitmap: change type of bitmap_weight to unsigned int
On Fri, Jul 01, 2022 at 05:54:25AM -0700, Yury Norov wrote:
> bitmap_weight() doesn't return negative values, so change it's type
> to unsigned int.

Patch (the code) suggests something else.

> It may help compiler to generate better code and
> catch bugs.

...

> -int __bitmap_weight(const unsigned long *bitmap, unsigned int nbits);
> +unsigned long __bitmap_weight(const unsigned long *bitmap, unsigned int nbits);

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2022-07-02 13:59    [W:0.074 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site