diff mbox series

[v4,4/6] pack-bitmap-write: remove unused bitmap_reset() function

Message ID patch-v4-4.6-a9b71c281c2-20220331T014349Z-avarab@gmail.com (mailing list archive)
State Accepted
Commit b676b73232fab679502f7c77e60f0852b4f2a09e
Headers show
Series various: remove dead code | expand

Commit Message

Ævar Arnfjörð Bjarmason March 31, 2022, 1:45 a.m. UTC
This function hasn't been used since 449fa5ee069 (pack-bitmap-write:
ignore BITMAP_FLAG_REUSE, 2020-12-08), which was a cleanup commit
intending to get rid of the code around the reusing of bitmaps.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 ewah/bitmap.c | 5 -----
 ewah/ewok.h   | 1 -
 2 files changed, 6 deletions(-)

Comments

Junio C Hamano March 31, 2022, 10:06 p.m. UTC | #1
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> This function hasn't been used since 449fa5ee069 (pack-bitmap-write:
> ignore BITMAP_FLAG_REUSE, 2020-12-08), which was a cleanup commit
> intending to get rid of the code around the reusing of bitmaps.
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  ewah/bitmap.c | 5 -----
>  ewah/ewok.h   | 1 -
>  2 files changed, 6 deletions(-)
>
> diff --git a/ewah/bitmap.c b/ewah/bitmap.c
> index 38a47c44db4..87d5cc8fa30 100644
> --- a/ewah/bitmap.c
> +++ b/ewah/bitmap.c
> @@ -216,11 +216,6 @@ int bitmap_is_subset(struct bitmap *self, struct bitmap *other)
>  	return 0;
>  }
>  
> -void bitmap_reset(struct bitmap *bitmap)
> -{
> -	memset(bitmap->words, 0x0, bitmap->word_alloc * sizeof(eword_t));
> -}
> -

It is kind of surprising that we used to want to "clear" a bitmap
array but no longer do so (read: "we may not use it right now, but
will we soon miss it?"), but the code removed here is simple,
obvious and trivial enough that anybody we does want to use it can
easily reinvent it.

So far, all patches look quite sensible.

Thanks.



>  void bitmap_free(struct bitmap *bitmap)
>  {
>  	if (bitmap == NULL)
> diff --git a/ewah/ewok.h b/ewah/ewok.h
> index 66920965da1..7eb8b9b6301 100644
> --- a/ewah/ewok.h
> +++ b/ewah/ewok.h
> @@ -177,7 +177,6 @@ struct bitmap *bitmap_dup(const struct bitmap *src);
>  void bitmap_set(struct bitmap *self, size_t pos);
>  void bitmap_unset(struct bitmap *self, size_t pos);
>  int bitmap_get(struct bitmap *self, size_t pos);
> -void bitmap_reset(struct bitmap *self);
>  void bitmap_free(struct bitmap *self);
>  int bitmap_equals(struct bitmap *self, struct bitmap *other);
>  int bitmap_is_subset(struct bitmap *self, struct bitmap *other);
diff mbox series

Patch

diff --git a/ewah/bitmap.c b/ewah/bitmap.c
index 38a47c44db4..87d5cc8fa30 100644
--- a/ewah/bitmap.c
+++ b/ewah/bitmap.c
@@ -216,11 +216,6 @@  int bitmap_is_subset(struct bitmap *self, struct bitmap *other)
 	return 0;
 }
 
-void bitmap_reset(struct bitmap *bitmap)
-{
-	memset(bitmap->words, 0x0, bitmap->word_alloc * sizeof(eword_t));
-}
-
 void bitmap_free(struct bitmap *bitmap)
 {
 	if (bitmap == NULL)
diff --git a/ewah/ewok.h b/ewah/ewok.h
index 66920965da1..7eb8b9b6301 100644
--- a/ewah/ewok.h
+++ b/ewah/ewok.h
@@ -177,7 +177,6 @@  struct bitmap *bitmap_dup(const struct bitmap *src);
 void bitmap_set(struct bitmap *self, size_t pos);
 void bitmap_unset(struct bitmap *self, size_t pos);
 int bitmap_get(struct bitmap *self, size_t pos);
-void bitmap_reset(struct bitmap *self);
 void bitmap_free(struct bitmap *self);
 int bitmap_equals(struct bitmap *self, struct bitmap *other);
 int bitmap_is_subset(struct bitmap *self, struct bitmap *other);