[PATCH 3/7] libsupport: don't use bzero in cache.c

Theodore Ts'o
2026-05-04T23:33:24Z

The bzero() function is deprecated and not available in some
platforms. It's not needed in any case because we can just use an
automatic initializer.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Fixes: 30b3c80ed6bc ("libsupport: add a cache")
---
lib/support/cache.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/support/cache.c b/lib/support/cache.c
index f9669e3fc..aec785347 100644
--- a/lib/support/cache.c
+++ b/lib/support/cache.c
@@ -850,7 +850,7 @@ cache_report(
{
int i;
unsigned long count, index, total;
- unsigned long hash_bucket_lengths[HASH_REPORT + 2];
+ unsigned long hash_bucket_lengths[HASH_REPORT + 2] = { 0 };

if ((cache->c_hits + cache->c_misses) == 0)
return;
@@ -886,8 +886,6 @@ cache_report(
cache->c_mrus[i].cm_count * 100 / cache->c_count);

/* report hash bucket lengths */
- bzero(hash_bucket_lengths, sizeof(hash_bucket_lengths));
-
for (i = 0; i < cache->c_hashsize; i++) {
count = cache->c_hash[i].ch_count;
if (count > HASH_REPORT)
--
2.53.0