Skip to content

Commit 7a70c15

Browse files
committed
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>
1 parent 69050f8 commit 7a70c15

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/media/tuners/tuner-i2c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static inline int tuner_i2c_xfer_send_recv(struct tuner_i2c_props *props,
132132
} \
133133
} \
134134
if (0 == __ret) { \
135-
state = kzalloc_obj(type, GFP_KERNEL); \
135+
state = kzalloc_obj(type, GFP_KERNEL); \
136136
if (NULL == state) \
137137
goto __fail; \
138138
state->i2c_props.addr = i2caddr; \

drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct l2addr_node {
7272
int ix = MLX5_L2_ADDR_HASH(mac); \
7373
type *ptr = NULL; \
7474
\
75-
ptr = kzalloc_obj(type, gfp); \
75+
ptr = kzalloc_obj(type, gfp); \
7676
if (ptr) { \
7777
ether_addr_copy(ptr->node.addr, mac); \
7878
hlist_add_head(&ptr->node.hlist, &(hash)[ix]);\

include/linux/dma-fence-chain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ dma_fence_chain_contained(struct dma_fence *fence)
9191
* intentional to enforce typesafety.
9292
*/
9393
#define dma_fence_chain_alloc() \
94-
((struct dma_fence_chain *) kmalloc_obj(struct dma_fence_chain, GFP_KERNEL))
94+
kmalloc_obj(struct dma_fence_chain, GFP_KERNEL)
9595

9696
/**
9797
* dma_fence_chain_free

include/linux/skmsg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ int sk_psock_msg_verdict(struct sock *sk, struct sk_psock *psock,
460460
* intentional to enforce typesafety.
461461
*/
462462
#define sk_psock_init_link() \
463-
((struct sk_psock_link *) kzalloc_obj(struct sk_psock_link, GFP_ATOMIC | __GFP_NOWARN))
463+
kzalloc_obj(struct sk_psock_link, GFP_ATOMIC | __GFP_NOWARN)
464464

465465
static inline void sk_psock_free_link(struct sk_psock_link *link)
466466
{

0 commit comments

Comments
 (0)