Skip to content

Commit

Permalink
bitmap: fix hwloc_bitmap_nr_ulongs()
Browse files Browse the repository at this point in the history
Thanks to Norbert Eicker for the report.

Closes #429

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Oct 28, 2020
1 parent a3a68b4 commit fd07760
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hwloc/bitmap.c
@@ -1,6 +1,6 @@
/*
* Copyright © 2009 CNRS
* Copyright © 2009-2018 Inria. All rights reserved.
* Copyright © 2009-2020 Inria. All rights reserved.
* Copyright © 2009-2011 Université Bordeaux
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
Expand Down Expand Up @@ -818,7 +818,7 @@ int hwloc_bitmap_nr_ulongs(const struct hwloc_bitmap_s *set)
return -1;

last = hwloc_bitmap_last(set);
return (last + HWLOC_BITS_PER_LONG-1)/HWLOC_BITS_PER_LONG;
return (last + HWLOC_BITS_PER_LONG)/HWLOC_BITS_PER_LONG;
}

int hwloc_bitmap_only(struct hwloc_bitmap_s * set, unsigned cpu)
Expand Down

0 comments on commit fd07760

Please sign in to comment.