mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +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
@@ -251,7 +251,7 @@ chksum_benchmark(void)
|
||||
/* space for the benchmark times */
|
||||
chksum_stat_cnt = 4;
|
||||
chksum_stat_cnt += blake3_impl_getcnt();
|
||||
chksum_stat_data = (chksum_stat_t *)kmem_zalloc(
|
||||
chksum_stat_data = kmem_zalloc(
|
||||
sizeof (chksum_stat_t) * chksum_stat_cnt, KM_SLEEP);
|
||||
|
||||
/* edonr - needs to be the first one here (slow CPU check) */
|
||||
|
||||
@@ -876,7 +876,7 @@ zfs_get_data(void *arg, uint64_t gen, lr_write_t *lr, char *buf,
|
||||
return (SET_ERROR(ENOENT));
|
||||
}
|
||||
|
||||
zgd = (zgd_t *)kmem_zalloc(sizeof (zgd_t), KM_SLEEP);
|
||||
zgd = kmem_zalloc(sizeof (zgd_t), KM_SLEEP);
|
||||
zgd->zgd_lwb = lwb;
|
||||
zgd->zgd_private = zp;
|
||||
|
||||
|
||||
+1
-1
@@ -646,7 +646,7 @@ zvol_get_data(void *arg, uint64_t arg2, lr_write_t *lr, char *buf,
|
||||
ASSERT3P(zio, !=, NULL);
|
||||
ASSERT3U(size, !=, 0);
|
||||
|
||||
zgd = (zgd_t *)kmem_zalloc(sizeof (zgd_t), KM_SLEEP);
|
||||
zgd = kmem_zalloc(sizeof (zgd_t), KM_SLEEP);
|
||||
zgd->zgd_lwb = lwb;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user