logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0012-Remove-definition-of-highbit64-and-lowbit64.patch (1644B)


  1. From cfc27efc55e81d952d96d7257b60fde6f9dff36d Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Wed, 29 Jan 2025 01:41:00 -0800
  4. Subject: [PATCH] Remove definition of highbit64 and lowbit64
  5. For zstream, this is normally defined in lib/libzpool/kernel.c, but
  6. that pulls in a bunch of other stuff.
  7. Instead, we'll just supply our own versions that support non-GNU
  8. compilers.
  9. ---
  10. cmd/zpool/zpool_util.c | 26 --------------------------
  11. cmd/zpool/zpool_util.h | 2 --
  12. 2 files changed, 28 deletions(-)
  13. diff --git a/cmd/zpool/zpool_util.c b/cmd/zpool/zpool_util.c
  14. index e7ff739e5..cd2c86995 100644
  15. --- a/cmd/zpool/zpool_util.c
  16. +++ b/cmd/zpool/zpool_util.c
  17. @@ -113,29 +113,3 @@ array64_max(uint64_t array[], unsigned int len)
  18. return (max);
  19. }
  20. -
  21. -/*
  22. - * Find highest one bit set.
  23. - * Returns bit number + 1 of highest bit that is set, otherwise returns 0.
  24. - */
  25. -int
  26. -highbit64(uint64_t i)
  27. -{
  28. - if (i == 0)
  29. - return (0);
  30. -
  31. - return (NBBY * sizeof (uint64_t) - __builtin_clzll(i));
  32. -}
  33. -
  34. -/*
  35. - * Find lowest one bit set.
  36. - * Returns bit number + 1 of lowest bit that is set, otherwise returns 0.
  37. - */
  38. -int
  39. -lowbit64(uint64_t i)
  40. -{
  41. - if (i == 0)
  42. - return (0);
  43. -
  44. - return (__builtin_ffsll(i));
  45. -}
  46. diff --git a/cmd/zpool/zpool_util.h b/cmd/zpool/zpool_util.h
  47. index 7f5406f06..f340e7bbc 100644
  48. --- a/cmd/zpool/zpool_util.h
  49. +++ b/cmd/zpool/zpool_util.h
  50. @@ -44,8 +44,6 @@ void *safe_realloc(void *, size_t);
  51. void zpool_no_memory(void);
  52. uint_t num_logs(nvlist_t *nv);
  53. uint64_t array64_max(uint64_t array[], unsigned int len);
  54. -int highbit64(uint64_t i);
  55. -int lowbit64(uint64_t i);
  56. /*
  57. * Misc utility functions
  58. --
  59. 2.44.0