e100: replace kmalloc with kcalloc
Subsystems (2)
PATCH 1/1 e100: replace kmalloc with kcalloc
Replace kmalloc+memset with kcalloc
Signed-off-by Yan Burman <[email protected]>
drivers/net/e100.c +1 -2
@@ -1930,9 +1930,8 @@ static int e100_rx_alloc_list(struct nic nic->rx_to_use = nic->rx_to_clean =NULL ; nic->ru_running =RU_UNINITIALIZED ; -if (!(nic->rxs =kmalloc (sizeof (struct rx ) * count,GFP_ATOMIC ))) +if (!(nic->rxs =kcalloc (count,sizeof (struct rx ),GFP_ATOMIC )))return -ENOMEM ; -memset (nic->rxs,0 ,sizeof (struct rx ) * count);for (rx = nic->rxs, i =0 ; i < count; rx++, i++) { rx->next = (i +1 < count) ? rx +1 : nic->rxs;
Quoted 1 line · Yan Burman
Replace kmalloc+memset with kcalloc
ACK, fine with me.
Quoted 25 lines
Signed-off-by Yan Burman <[email protected]>diff -rubp
linux-2.6.19-rc5_orig/drivers/net/e100.clinux-2.6.19-rc5_kzalloc/drivers/net/e100.cdrivers/net/e100.c +1
-3@@ -1930,9 +1930,8 @@ static int e100_rx_alloc_list(struct nic nic->rx_to_use = nic->rx_to_clean =NULL ; nic->ru_running =RU_UNINITIALIZED ; -if (!(nic->rxs =kmalloc (sizeof (struct rx ) * count,GFP_ATOMIC ))) +if (!(nic->rxs =kcalloc (count,sizeof (struct rx ),GFP_ATOMIC )))return -ENOMEM ; -memset (nic->rxs,0 ,sizeof (struct rx ) * count);for (rx = nic->rxs, i =0 ; i < count; rx++, i++) { rx->next = (i +1 < count) ? rx +1 : nic->rxs; -To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/