Skip to contentSkip to conversation

lib/xxhash: Remove unused functions

PATCH Applied [email protected] 2 participants 4 messages Jul 16, 2025 – Oct 24, 2025 Library code

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 lib/xxhash: Remove unused functions

From: "Dr. David Alan Gilbert" <[email protected]>

xxh32_digest() and xxh32_update() were added in 2017 in the original xxhash commit, but have remained unused.

Remove them.

---
v2
Actually remove the code rather than comment it out (Christoph)

 include/linux/xxhash.h |  26 ----------
 lib/xxhash.c           | 107 -----------------------------------------
 2 files changed, 133 deletions(-)
include/linux/xxhash.h +0 -26
index df42511438d0..27f57eca8cb1 100644
@@ -177,32 +177,6 @@ struct xxh64_state {
  */
 void xxh32_reset(struct xxh32_state *state, uint32_t seed);
 
-/**
- * xxh32_update() - hash the data given and update the xxh32 state
- *
- * @state:  The xxh32 state to update.
- * @input:  The data to hash.
- * @length: The length of the data to hash.
- *
- * After calling xxh32_reset() call xxh32_update() as many times as necessary.
- *
- * Return:  Zero on success, otherwise an error code.
- */
-int xxh32_update(struct xxh32_state *state, const void *input, size_t length);
-
-/**
- * xxh32_digest() - produce the current xxh32 hash
- *
- * @state: Produce the current xxh32 hash of this state.
- *
- * A hash value can be produced at any time. It is still possible to continue
- * inserting input into the hash state after a call to xxh32_digest(), and
- * generate new hashes later on, by calling xxh32_digest() again.
- *
- * Return: The xxh32 hash stored in the state.
- */
-uint32_t xxh32_digest(const struct xxh32_state *state);
-
 /**
  * xxh64_reset() - reset the xxh64 state to start a new hashing operation
  *
lib/xxhash.c +0 -107

113 lines not on this page · raw message

Signature · 1 line
2.50.1
#3 lore raw
Quoted 7 lines · * Christoph Hellwig ([email protected]) wrote:
Quoted 3 lines · Christoph Hellwig

Looks good:

Btw, with this, xxh32_reset, xxh32_copy_state and xxh64_copy_state are entirely unused now, and with that struct xxh32_state as well.

Oh, so they are - I'm on it.

Dave

Signature · 4 lines
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/