]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
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 336acbbc622bb952b34d1b10f112aa7b9bc59aad..ce9a065cde04ea622c9f42a59d6b4f64fd3e5565 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 e864e5c430e00310996e36eabee276bc2f2393e0..051f68ab4cef93943e63e930ccd8cb43dd10d111 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 3267ab0e8c54a104acbf2281990917e6c7e13827..e5f4451a6375da86a80c7f5c288b11c5f498523d 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 a8513e40176080cbfd40a1911cb281b93e9b347b..19f4f253b4f908948a8e8e371b46d1514087910a 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)
 {