* [PATCH] ipw2x00: Use kzalloc instead of kmalloc/memset
@ 2024-07-04 9:06 Chen Ni
2024-07-09 10:16 ` wifi: ipw2x00: Use kzalloc() instead of kmalloc()/memset() Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Chen Ni @ 2024-07-04 9:06 UTC (permalink / raw)
To: stas.yakovlev, kvalo; +Cc: linux-wireless, linux-kernel, Chen Ni
replace kmalloc + memset to kzalloc for
better code readability and simplicity.
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
drivers/net/wireless/intel/ipw2x00/libipw_tx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_tx.c b/drivers/net/wireless/intel/ipw2x00/libipw_tx.c
index 4aec1fce1ae2..e22a6732a4c3 100644
--- a/drivers/net/wireless/intel/ipw2x00/libipw_tx.c
+++ b/drivers/net/wireless/intel/ipw2x00/libipw_tx.c
@@ -180,11 +180,10 @@ static struct libipw_txb *libipw_alloc_txb(int nr_frags, int txb_size,
struct libipw_txb *txb;
int i;
- txb = kmalloc(struct_size(txb, fragments, nr_frags), gfp_mask);
+ txb = kzalloc(struct_size(txb, fragments, nr_frags), gfp_mask);
if (!txb)
return NULL;
- memset(txb, 0, sizeof(struct libipw_txb));
txb->nr_frags = nr_frags;
txb->frag_size = txb_size;
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-09 10:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-04 9:06 [PATCH] ipw2x00: Use kzalloc instead of kmalloc/memset Chen Ni
2024-07-09 10:16 ` wifi: ipw2x00: Use kzalloc() instead of kmalloc()/memset() Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®