mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Cleanup: Remove unnecessary explicit casts of pointers from allocators
The Linux 5.16.14 kernel's coccicheck caught these. The semantic patch that caught them was: ./scripts/coccinelle/api/alloc/alloc_cast.cocci Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Closes #14372
This commit is contained in:
committed by
Brian Behlendorf
parent
80d64bb85f
commit
7384ec65cd
@@ -211,7 +211,7 @@ aes_alloc_keysched(size_t *size, int kmflag)
|
||||
{
|
||||
aes_key_t *keysched;
|
||||
|
||||
keysched = (aes_key_t *)kmem_alloc(sizeof (aes_key_t), kmflag);
|
||||
keysched = kmem_alloc(sizeof (aes_key_t), kmflag);
|
||||
if (keysched != NULL) {
|
||||
*size = sizeof (aes_key_t);
|
||||
return (keysched);
|
||||
|
||||
@@ -653,7 +653,7 @@ gcm_init_ctx(gcm_ctx_t *gcm_ctx, char *param, size_t block_size,
|
||||
}
|
||||
gcm_ctx->gcm_htab_len = htab_len;
|
||||
gcm_ctx->gcm_Htable =
|
||||
(uint64_t *)kmem_alloc(htab_len, KM_SLEEP);
|
||||
kmem_alloc(htab_len, KM_SLEEP);
|
||||
|
||||
if (gcm_ctx->gcm_Htable == NULL) {
|
||||
return (CRYPTO_HOST_MEMORY);
|
||||
@@ -728,7 +728,7 @@ gmac_init_ctx(gcm_ctx_t *gcm_ctx, char *param, size_t block_size,
|
||||
}
|
||||
gcm_ctx->gcm_htab_len = htab_len;
|
||||
gcm_ctx->gcm_Htable =
|
||||
(uint64_t *)kmem_alloc(htab_len, KM_SLEEP);
|
||||
kmem_alloc(htab_len, KM_SLEEP);
|
||||
|
||||
if (gcm_ctx->gcm_Htable == NULL) {
|
||||
return (CRYPTO_HOST_MEMORY);
|
||||
|
||||
@@ -88,7 +88,7 @@ crypto_create_ctx_template(crypto_mechanism_t *mech, crypto_key_t *key,
|
||||
if (error != CRYPTO_SUCCESS)
|
||||
return (error);
|
||||
|
||||
if ((ctx_tmpl = (kcf_ctx_template_t *)kmem_alloc(
|
||||
if ((ctx_tmpl = kmem_alloc(
|
||||
sizeof (kcf_ctx_template_t), KM_SLEEP)) == NULL) {
|
||||
KCF_PROV_REFRELE(pd);
|
||||
return (CRYPTO_HOST_MEMORY);
|
||||
|
||||
Reference in New Issue
Block a user