Commit 7a70c15bd144 for kernel
commit 7a70c15bd1449f1eb30991772edce37b41e496fb
Author: Kees Cook <kees@kernel.org>
Date: Sat Feb 21 00:12:19 2026 -0800
kmalloc_obj: Clean up after treewide replacements
Coccinelle doesn't handle re-indenting line escapes. Fix the 2 places
where these got misaligned.
Remove 2 now-redundant type casts, found with:
$ git grep -P 'struct (\S+).*\)\s*k\S+alloc_(objs?|flex)\(struct \1'
Signed-off-by: Kees Cook <kees@kernel.org>
diff --git a/drivers/media/tuners/tuner-i2c.h b/drivers/media/tuners/tuner-i2c.h
index 336acbbc622b..ce9a065cde04 100644
--- a/drivers/media/tuners/tuner-i2c.h
+++ b/drivers/media/tuners/tuner-i2c.h
@@ -132,7 +132,7 @@ static inline int tuner_i2c_xfer_send_recv(struct tuner_i2c_props *props,
} \
} \
if (0 == __ret) { \
- state = kzalloc_obj(type, GFP_KERNEL); \
+ state = kzalloc_obj(type, GFP_KERNEL); \
if (NULL == state) \
goto __fail; \
state->i2c_props.addr = i2caddr; \
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.h b/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.h
index e864e5c430e0..051f68ab4cef 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.h
@@ -72,7 +72,7 @@ struct l2addr_node {
int ix = MLX5_L2_ADDR_HASH(mac); \
type *ptr = NULL; \
\
- ptr = kzalloc_obj(type, gfp); \
+ ptr = kzalloc_obj(type, gfp); \
if (ptr) { \
ether_addr_copy(ptr->node.addr, mac); \
hlist_add_head(&ptr->node.hlist, &(hash)[ix]);\
diff --git a/include/linux/dma-fence-chain.h b/include/linux/dma-fence-chain.h
index 3267ab0e8c54..e5f4451a6375 100644
--- a/include/linux/dma-fence-chain.h
+++ b/include/linux/dma-fence-chain.h
@@ -91,7 +91,7 @@ dma_fence_chain_contained(struct dma_fence *fence)
* intentional to enforce typesafety.
*/
#define dma_fence_chain_alloc() \
- ((struct dma_fence_chain *) kmalloc_obj(struct dma_fence_chain, GFP_KERNEL))
+ kmalloc_obj(struct dma_fence_chain, GFP_KERNEL)
/**
* dma_fence_chain_free
diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h
index a8513e401760..19f4f253b4f9 100644
--- a/include/linux/skmsg.h
+++ b/include/linux/skmsg.h
@@ -460,7 +460,7 @@ int sk_psock_msg_verdict(struct sock *sk, struct sk_psock *psock,
* intentional to enforce typesafety.
*/
#define sk_psock_init_link() \
- ((struct sk_psock_link *) kzalloc_obj(struct sk_psock_link, GFP_ATOMIC | __GFP_NOWARN))
+ kzalloc_obj(struct sk_psock_link, GFP_ATOMIC | __GFP_NOWARN)
static inline void sk_psock_free_link(struct sk_psock_link *link)
{