From: Stefan Roese <sr@denx.de>
To: devicetree-discuss@ozlabs.org
Cc: Grant Likely <grant.likely@secretlab.ca>,
linuxppc-dev@ozlabs.org, linux-mtd@lists.infradead.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 [thread overview]
Message-ID: <200904141457.06664.sr@denx.de> (raw)
In-Reply-To: <fa686aa40904112258n1cc23b48t80b135b7016e9760@mail.gmail.com>
On Sunday 12 April 2009, Grant Likely wrote:
> > + info = kzalloc(sizeof(struct of_flash) +
> > + sizeof(struct of_flash_list) * count, GFP_KERNEL);
> > + if (!info)
> > + goto err_out;
> > +
> > + mtd_list = 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
WARNING: multiple messages have this Message-ID (diff)
From: Stefan Roese <sr@denx.de>
To: devicetree-discuss@ozlabs.org
Cc: linuxppc-dev@ozlabs.org, linux-mtd@lists.infradead.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 [thread overview]
Message-ID: <200904141457.06664.sr@denx.de> (raw)
In-Reply-To: <fa686aa40904112258n1cc23b48t80b135b7016e9760@mail.gmail.com>
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
WARNING: multiple messages have this Message-ID (diff)
From: Stefan Roese <sr-ynQEQJNshbs@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
Subject: Re: [PATCH 1/4 v2] mtd: physmap_of: Add multiple regions and concatenation support
Date: Tue, 14 Apr 2009 14:57:06 +0200 [thread overview]
Message-ID: <200904141457.06664.sr@denx.de> (raw)
In-Reply-To: <fa686aa40904112258n1cc23b48t80b135b7016e9760-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Sunday 12 April 2009, Grant Likely wrote:
> > + info = kzalloc(sizeof(struct of_flash) +
> > + sizeof(struct of_flash_list) * count, GFP_KERNEL);
> > + if (!info)
> > + goto err_out;
> > +
> > + mtd_list = 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
next prev parent reply other threads:[~2009-04-14 12:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-07 8:39 [PATCH 1/4 v2] mtd: physmap_of: Add multiple regions and concatenation support Stefan Roese
2009-04-07 8:39 ` Stefan Roese
2009-04-07 8:39 ` Stefan Roese
2009-04-12 5:58 ` Grant Likely
2009-04-12 5:58 ` Grant Likely
2009-04-14 12:42 ` Stefan Roese
2009-04-14 12:42 ` Stefan Roese
2009-04-14 12:57 ` Stefan Roese [this message]
2009-04-14 12:57 ` Stefan Roese
2009-04-14 12:57 ` Stefan Roese
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200904141457.06664.sr@denx.de \
--to=sr@denx.de \
--cc=devicetree-discuss@ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=linux-mtd@lists.infradead.org \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.