crypto: zstd - Remove unnecessary size_t cast
Subsystems (2)
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.
Signed-off-by Thorsten Blum <[email protected]>
--- crypto/zstd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
crypto/zstd.c +2 -3
@@ -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 (¶ms.cParams), -zstd_dstream_workspace_bound (ZSTD_MAX_SIZE )); + wksp_size =max (zstd_cstream_workspace_bound (¶ms.cParams), +zstd_dstream_workspace_bound (ZSTD_MAX_SIZE ));if (!wksp_size)return ERR_PTR (-EINVAL );
Signature · 1 line
2.51.1
Quoted 5 lines · Thorsten Blum
Use
max()instead ofmax_t()sincezstd_cstream_workspace_bound()andzstd_dstream_workspace_bound()already returnsize_tand casting the values is unnecessary.Signed-off-by Thorsten Blum <[email protected]>
Reviewed-by David Sterba <[email protected]>
Herbert Xu
maintainerQuoted 8 lines · Thorsten Blum
Use
max()instead ofmax_t()sincezstd_cstream_workspace_bound()andzstd_dstream_workspace_bound()already returnsize_tand casting the values is unnecessary.Signed-off-by Thorsten Blum <[email protected]>--- 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