This is an API consolidation only. The use of kmalloc of an array of elements of equal size + memset to 0 of the same is equivalent to kcalloc. Signed-off-by: Nicholas Mc Guire <hofrat@xxxxxxxxx> --- Found by coccinelle script (relaxed version of scripts/coccinelle/api/alloc/kzalloc-simple.cocci) Patch was compile tested with: x86_64_defconfig + CONFIG_STAGING=y, CONFIG_R8712U=m Patch is against linux-next (localversion-next is -next-20160104) drivers/staging/rtl8712/rtl871x_recv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c index 4ff5301..aa841bf 100644 --- a/drivers/staging/rtl8712/rtl871x_recv.c +++ b/drivers/staging/rtl8712/rtl871x_recv.c @@ -72,14 +72,12 @@ sint _r8712_init_recv_priv(struct recv_priv *precvpriv, _init_queue(&precvpriv->recv_pending_queue); precvpriv->adapter = padapter; precvpriv->free_recvframe_cnt = NR_RECVFRAME; - precvpriv->pallocated_frame_buf = kmalloc(NR_RECVFRAME * + precvpriv->pallocated_frame_buf = kcalloc(NR_RECVFRAME, sizeof(union recv_frame) + RXFRAME_ALIGN_SZ, GFP_ATOMIC); if (precvpriv->pallocated_frame_buf == NULL) return _FAIL; kmemleak_not_leak(precvpriv->pallocated_frame_buf); - memset(precvpriv->pallocated_frame_buf, 0, NR_RECVFRAME * - sizeof(union recv_frame) + RXFRAME_ALIGN_SZ); precvpriv->precv_frame_buf = precvpriv->pallocated_frame_buf + RXFRAME_ALIGN_SZ - ((addr_t)(precvpriv->pallocated_frame_buf) & -- 2.1.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel