From mboxrd@z Thu Jan 1 00:00:00 1970 From: Emil Medve Subject: [PATCH 10/26] iommu/fsl: Fix checkpatch type ALLOC_WITH_MULTIPLY Date: Wed, 28 Jan 2015 08:34:42 -0600 Message-ID: <1422455698-3074-11-git-send-email-Emilian.Medve@Freescale.com> References: <1422455698-3074-1-git-send-email-Emilian.Medve@Freescale.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org, jroedel-l3A5Bk7waGM@public.gmane.org, Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org Cc: Emil Medve List-Id: iommu@lists.linux-foundation.org WARNING:ALLOC_WITH_MULTIPLY: Prefer kcalloc over kzalloc with multiply + dma_domain->win_arr = kzalloc(sizeof(*dma_domain->win_arr) * + w_count, GFP_ATOMIC); Signed-off-by: Emil Medve --- drivers/iommu/fsl_pamu_domain.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index 9417207..dcb9bb4 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c @@ -1037,8 +1037,9 @@ static int fsl_pamu_set_windows(struct iommu_domain *domain, u32 w_count) ((w_count > 1) ? w_count : 0)); if (!ret) { kfree(dma_domain->win_arr); - dma_domain->win_arr = kzalloc(sizeof(*dma_domain->win_arr) * - w_count, GFP_ATOMIC); + dma_domain->win_arr = kcalloc(w_count, + sizeof(*dma_domain->win_arr), + GFP_ATOMIC); if (!dma_domain->win_arr) { spin_unlock_irqrestore(&dma_domain->domain_lock, flags); return -ENOMEM; -- 2.2.2