From: Florian Fainelli <ffainelli@freebox.fr>
To: "Ira W. Snyder" <iws@ovro.caltech.edu>
Cc: dwmw2@infradead.org, Florian Fainelli <ffainelli@freebox.fr>,
linux-mtd@lists.infradead.org, dedekind1@gmail.com
Subject: Re: [PATCH] MTD: make panic_write() conditional to CONFIG_MTD_OOPS
Date: Tue, 10 Jan 2012 18:02:00 +0100 (CET) [thread overview]
Message-ID: <834779565.1495241326214920100.JavaMail.root@zimbra-corp-1-b8> (raw)
In-Reply-To: <20120110165554.GB30403@ovro.caltech.edu>
Hello Ira,
----- "Ira W. Snyder" <iws@ovro.caltech.edu> a écrit :
> On Tue, Jan 10, 2012 at 05:51:03PM +0100, Florian Fainelli wrote:
> > The mtdoops driver is the only user of the panic_write callback
> > make all panic_write related code conditionnal to CONFIG_MTD_OOPS
> > so we can save some code. Since CONFIG_MTD_OOPS can be a module
> > use the newly introduced IS_ENABLED() macro to cope with that.
> >
> > It is safe to define the panic_write callback as NULL when
> > CONFIG_MTD_OOPS is disabled since the mtdoops drivers check for the
> > callback being non-NULL and returns an error if this the case.
> >
> > Signed-off-by: Florian Fainelli <ffainelli@freebox.fr>
> > ---
[snip]
> > diff --git a/drivers/mtd/onenand/onenand_base.c
> b/drivers/mtd/onenand/onenand_base.c
> > index a061bc1..9f6a2a9 100644
> > --- a/drivers/mtd/onenand/onenand_base.c
> > +++ b/drivers/mtd/onenand/onenand_base.c
> > @@ -1736,6 +1736,7 @@ static void onenand_panic_wait(struct mtd_info
> *mtd)
> > *
> > * Write with ECC
> > */
> > +#if IS_ENABLED(CONFIG_MTD_OOPS)
>
> This #if should be moved up above onenand_panic_wait() which is only
> used from onenand_panic_write().
Indeed, thanks for spotting this.
>
> Other than that, the patch looks good to me.
Thanks.
--
Florian
>
> Ira
>
> > static int onenand_panic_write(struct mtd_info *mtd, loff_t to,
> size_t len,
> > size_t *retlen, const u_char *buf)
> > {
> > @@ -1819,6 +1820,10 @@ static int onenand_panic_write(struct
> mtd_info *mtd, loff_t to, size_t len,
> > *retlen = written;
> > return ret;
> > }
> > +#else
> > +#define onenand_panic_write NULL
> > +#endif
> > +
> >
> > /**
> > * onenand_fill_auto_oob - [INTERN] oob auto-placement transfer
> > --
> > 1.7.5.4
> >
next prev parent reply other threads:[~2012-01-10 17:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4F0C061B.9030802@freebox.fr>
2012-01-10 16:51 ` [PATCH] MTD: make panic_write() conditional to CONFIG_MTD_OOPS Florian Fainelli
2012-01-10 16:55 ` Ira W. Snyder
2012-01-10 17:02 ` Florian Fainelli [this message]
2012-01-10 17:02 ` [PATCH v2] MTD: make panic_write() conditionnal " Florian Fainelli
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=834779565.1495241326214920100.JavaMail.root@zimbra-corp-1-b8 \
--to=ffainelli@freebox.fr \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=iws@ovro.caltech.edu \
--cc=linux-mtd@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox