From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mo-p05-ob.rzone.de ([81.169.146.180]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1LtiCK-0001RA-Rn for linux-mtd@lists.infradead.org; Tue, 14 Apr 2009 12:57:15 +0000 From: Stefan Roese To: devicetree-discuss@ozlabs.org Subject: Re: [PATCH 1/4 v2] mtd: physmap_of: Add multiple regions and concatenation support Date: Tue, 14 Apr 2009 14:57:06 +0200 References: <1239093559-12043-1-git-send-email-sr@denx.de> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200904141457.06664.sr@denx.de> Cc: Grant Likely , linuxppc-dev@ozlabs.org, linux-mtd@lists.infradead.org List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Sunday 12 April 2009, Grant Likely wrote: > > + =A0 =A0 =A0 info =3D kzalloc(sizeof(struct of_flash) + > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sizeof(struct of_flash_lis= t) * count, GFP_KERNEL); > > + =A0 =A0 =A0 if (!info) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err_out; > > + > > + =A0 =A0 =A0 mtd_list =3D kzalloc(sizeof(struct mtd_info) * count, GFP= _KERNEL); > > Typically I prefer to see a single kzalloc in a driver which allocates > all the space needed in one go because it simplifies the error/unwind > path. In general ack, but it doesn't make much sense in this case. The 2nd malloc= is=20 for an temporary buffer needed for mtd_concat_create() call (list of struct= =20 mtd_info. I can't really combine those two areas. So I'll leave this=20 untouched. Best regards, Stefan From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Stefan Roese To: devicetree-discuss@ozlabs.org Subject: Re: [PATCH 1/4 v2] mtd: physmap_of: Add multiple regions and concatenation support Date: Tue, 14 Apr 2009 14:57:06 +0200 References: <1239093559-12043-1-git-send-email-sr@denx.de> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Message-Id: <200904141457.06664.sr@denx.de> Cc: linuxppc-dev@ozlabs.org, linux-mtd@lists.infradead.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Sunday 12 April 2009, Grant Likely wrote: > > + =A0 =A0 =A0 info =3D kzalloc(sizeof(struct of_flash) + > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sizeof(struct of_flash_lis= t) * count, GFP_KERNEL); > > + =A0 =A0 =A0 if (!info) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err_out; > > + > > + =A0 =A0 =A0 mtd_list =3D kzalloc(sizeof(struct mtd_info) * count, GFP= _KERNEL); > > Typically I prefer to see a single kzalloc in a driver which allocates > all the space needed in one go because it simplifies the error/unwind > path. In general ack, but it doesn't make much sense in this case. The 2nd malloc= is=20 for an temporary buffer needed for mtd_concat_create() call (list of struct= =20 mtd_info. I can't really combine those two areas. So I'll leave this=20 untouched. Best regards, Stefan From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Subject: Re: [PATCH 1/4 v2] mtd: physmap_of: Add multiple regions and concatenation support Date: Tue, 14 Apr 2009 14:57:06 +0200 Message-ID: <200904141457.06664.sr@denx.de> References: <1239093559-12043-1-git-send-email-sr@denx.de> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-mnsaURCQ41sdnm+yROfE0A@public.gmane.org Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-mnsaURCQ41sdnm+yROfE0A@public.gmane.org To: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org Cc: linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org, linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: devicetree@vger.kernel.org On Sunday 12 April 2009, Grant Likely wrote: > > + =A0 =A0 =A0 info =3D kzalloc(sizeof(struct of_flash) + > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sizeof(struct of_flash_lis= t) * count, GFP_KERNEL); > > + =A0 =A0 =A0 if (!info) > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err_out; > > + > > + =A0 =A0 =A0 mtd_list =3D kzalloc(sizeof(struct mtd_info) * count, GFP= _KERNEL); > > Typically I prefer to see a single kzalloc in a driver which allocates > all the space needed in one go because it simplifies the error/unwind > path. In general ack, but it doesn't make much sense in this case. The 2nd malloc= is = for an temporary buffer needed for mtd_concat_create() call (list of struct = mtd_info. I can't really combine those two areas. So I'll leave this = untouched. Best regards, Stefan