linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: zstd - Remove unnecessary size_t cast
@ 2025-11-08 14:57 Thorsten Blum
  2025-11-13 11:33 ` David Sterba
  2025-11-14 10:24 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Thorsten Blum @ 2025-11-08 14:57 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller, Nick Terrell, David Sterba
  Cc: Thorsten Blum, linux-crypto, linux-kernel

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.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 crypto/zstd.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/crypto/zstd.c b/crypto/zstd.c
index ac318d333b68..ff21cab382ba 100644
--- a/crypto/zstd.c
+++ b/crypto/zstd.c
@@ -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);
 
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: zstd - Remove unnecessary size_t cast
  2025-11-08 14:57 [PATCH] crypto: zstd - Remove unnecessary size_t cast Thorsten Blum
@ 2025-11-13 11:33 ` David Sterba
  2025-11-14 10:24 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2025-11-13 11:33 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Herbert Xu, David S. Miller, Nick Terrell, David Sterba,
	linux-crypto, linux-kernel

On Sat, Nov 08, 2025 at 03:57:07PM +0100, Thorsten Blum wrote:
> 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.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

Reviewed-by: David Sterba <dsterba@suse.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: zstd - Remove unnecessary size_t cast
  2025-11-08 14:57 [PATCH] crypto: zstd - Remove unnecessary size_t cast Thorsten Blum
  2025-11-13 11:33 ` David Sterba
@ 2025-11-14 10:24 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2025-11-14 10:24 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: David S. Miller, Nick Terrell, David Sterba, linux-crypto,
	linux-kernel

On Sat, Nov 08, 2025 at 03:57:07PM +0100, Thorsten Blum wrote:
> 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.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  crypto/zstd.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-14 10:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-08 14:57 [PATCH] crypto: zstd - Remove unnecessary size_t cast Thorsten Blum
2025-11-13 11:33 ` David Sterba
2025-11-14 10:24 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).