From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Date: Mon, 18 Sep 2006 01:19:19 +0000 Subject: Re: [KJ] kmalloc to kzalloc patches for drivers/atm Message-Id: <200609172119.20555.dtor@insightbb.com> List-Id: References: <6b4e42d10609171753i63697c8et3e6e1c5706b60d5f@mail.gmail.com> In-Reply-To: <6b4e42d10609171753i63697c8et3e6e1c5706b60d5f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Om Narasimhan Cc: linux-kernel@vger.kernel.org, kernel-janitors@lists.osdl.org, linux-atm-general@lists.sourceforge.net On Sunday 17 September 2006 20:53, Om Narasimhan wrote: > --- a/drivers/atm/firestream.c > +++ b/drivers/atm/firestream.c > @@ -1784,7 +1784,7 @@ static int __devinit fs_init (struct fs_ > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0write_fs (dev, RAM, (1 <<= (28 - FS155_VPI_BITS - FS155_VCI_BITS)) - 1); > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0dev->nchannels =3D FS155_= NR_CHANNELS; > =A0=A0=A0=A0=A0=A0=A0=A0} > -=A0=A0=A0=A0=A0=A0=A0dev->atm_vccs =3D kmalloc (dev->nchannels * sizeof = (struct atm_vcc *), > +=A0=A0=A0=A0=A0=A0=A0dev->atm_vccs =3D kzalloc (dev->nchannels * sizeof = (struct atm_vcc *), > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 GFP_KERNEL); > =A0=A0=A0=A0=A0=A0=A0=A0fs_dprintk (FS_DEBUG_ALLOC, "Alloc atmvccs: %p(%Z= d)\n", > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0dev->atm_vccs, de= v->nchannels * sizeof (struct atm_vcc *)); >=20 kcalloc would be better here because you are allocating several objects at once. --=20 Dmitry _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.osdl.org https://lists.osdl.org/mailman/listinfo/kernel-janitors From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965209AbWIRBTZ (ORCPT ); Sun, 17 Sep 2006 21:19:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S965210AbWIRBTZ (ORCPT ); Sun, 17 Sep 2006 21:19:25 -0400 Received: from gateway.insightbb.com ([74.128.0.19]:13072 "EHLO asav07.insightbb.com") by vger.kernel.org with ESMTP id S965209AbWIRBTY convert rfc822-to-8bit (ORCPT ); Sun, 17 Sep 2006 21:19:24 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AR4FAL6PDUWBT4oRLA From: Dmitry Torokhov To: Om Narasimhan Subject: Re: kmalloc to kzalloc patches for drivers/atm Date: Sun, 17 Sep 2006 21:19:19 -0400 User-Agent: KMail/1.9.3 Cc: linux-kernel@vger.kernel.org, kernel-janitors@lists.osdl.org, linux-atm-general@lists.sourceforge.net References: <6b4e42d10609171753i63697c8et3e6e1c5706b60d5f@mail.gmail.com> In-Reply-To: <6b4e42d10609171753i63697c8et3e6e1c5706b60d5f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Content-Disposition: inline Message-Id: <200609172119.20555.dtor@insightbb.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sunday 17 September 2006 20:53, Om Narasimhan wrote: > --- a/drivers/atm/firestream.c > +++ b/drivers/atm/firestream.c > @@ -1784,7 +1784,7 @@ static int __devinit fs_init (struct fs_ >                 write_fs (dev, RAM, (1 << (28 - FS155_VPI_BITS - FS155_VCI_BITS)) - 1); >                 dev->nchannels = FS155_NR_CHANNELS; >         } > -       dev->atm_vccs = kmalloc (dev->nchannels * sizeof (struct atm_vcc *), > +       dev->atm_vccs = kzalloc (dev->nchannels * sizeof (struct atm_vcc *), >                                  GFP_KERNEL); >         fs_dprintk (FS_DEBUG_ALLOC, "Alloc atmvccs: %p(%Zd)\n", >                     dev->atm_vccs, dev->nchannels * sizeof (struct atm_vcc *)); > kcalloc would be better here because you are allocating several objects at once. -- Dmitry