mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +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
@@ -146,7 +146,7 @@ callb_add_common(boolean_t (*func)(void *arg, int code),
|
||||
cv_wait(&ct->ct_busy_cv, &ct->ct_lock);
|
||||
if ((cp = ct->ct_freelist) == NULL) {
|
||||
ct->ct_ncallb++;
|
||||
cp = (callb_t *)kmem_zalloc(sizeof (callb_t), KM_SLEEP);
|
||||
cp = kmem_zalloc(sizeof (callb_t), KM_SLEEP);
|
||||
}
|
||||
ct->ct_freelist = cp->c_next;
|
||||
cp->c_thread = t;
|
||||
|
||||
@@ -701,7 +701,7 @@ spl_kmem_cache_create(const char *name, size_t size, size_t align,
|
||||
|
||||
skc->skc_magic = SKC_MAGIC;
|
||||
skc->skc_name_size = strlen(name) + 1;
|
||||
skc->skc_name = (char *)kmalloc(skc->skc_name_size, lflags);
|
||||
skc->skc_name = kmalloc(skc->skc_name_size, lflags);
|
||||
if (skc->skc_name == NULL) {
|
||||
kfree(skc);
|
||||
return (NULL);
|
||||
|
||||
Reference in New Issue
Block a user