From mboxrd@z Thu Jan 1 00:00:00 1970 From: Varun Sethi Subject: RE: [PATCH 10/26] iommu/fsl: Fix checkpatch type ALLOC_WITH_MULTIPLY Date: Fri, 30 Jan 2015 07:33:03 +0000 Message-ID: References: <1422455698-3074-1-git-send-email-Emilian.Medve@Freescale.com> <1422455698-3074-11-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-11-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org> Content-Language: en-US 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" Cc: Emilian Medve List-Id: iommu@lists.linux-foundation.org > -----Original Message----- > From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org] > Sent: Wednesday, January 28, 2015 8:05 PM > To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org; > Sethi Varun-B16395 > Cc: Medve Emilian-EMMEDVE1 > Subject: [PATCH 10/26] iommu/fsl: Fix checkpatch type > ALLOC_WITH_MULTIPLY > > 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 Acked-by: Varun Sethi