Skip to contentSkip to conversation

crypto: zstd - Remove unnecessary size_t cast

PATCH In review Thorsten Blum 3 participants 3 messages Nov 8, 2025 – Nov 14, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: zstd - Remove unnecessary size_t cast

Use max() instead of max_t() since zstd_cstream_workspace_bound() and zstd_dstream_workspace_bound() already return size_t and casting the values is unnecessary.

---
 crypto/zstd.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
crypto/zstd.c +2 -3
index ac318d333b68..ff21cab382ba 100644
@@ -38,9 +38,8 @@ static void *zstd_alloc_stream(void)
 
 	params = zstd_get_params(ZSTD_DEF_LEVEL, ZSTD_MAX_SIZE);
 
-	wksp_size = max_t(size_t,
-			  zstd_cstream_workspace_bound(&params.cParams),
-			  zstd_dstream_workspace_bound(ZSTD_MAX_SIZE));
+	wksp_size = max(zstd_cstream_workspace_bound(&params.cParams),
+			zstd_dstream_workspace_bound(ZSTD_MAX_SIZE));
 	if (!wksp_size)
 		return ERR_PTR(-EINVAL);
 
Signature · 1 line
2.51.1
maintainer
#2 lore raw
In reply to Thorsten Blum
Quoted 8 lines · Thorsten Blum

Use max() instead of max_t() since zstd_cstream_workspace_bound() and zstd_dstream_workspace_bound() already return size_t and casting the values is unnecessary.

---
 crypto/zstd.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt