kmalloc_obj: Clean up after treewide replacements
authorKees Cook <kees@kernel.org>
Sat, 21 Feb 2026 08:12:19 +0000 (00:12 -0800)
committerKees Cook <kees@kernel.org>
Sat, 21 Feb 2026 09:02:52 +0000 (01:02 -0800)
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>
drivers/media/tuners/tuner-i2c.h
drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.h
include/linux/dma-fence-chain.h
include/linux/skmsg.h

index 336acbb..ce9a065 100644 (file)
@@ -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;                        \
index e864e5c..051f68a 100644 (file)
@@ -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]);\
index 3267ab0..e5f4451 100644 (file)
@@ -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
index a8513e4..19f4f25 100644 (file)
@@ -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)
 {