mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] mtd: nand_base: replace ifdef with IS_ENABLE
Date: Wed, 5 Aug 2015 11:28:44 +0300	[thread overview]
Message-ID: <20150805112844.d8fc268394120c97f6e62c5c@gmail.com> (raw)
In-Reply-To: <20150805075356.GE18700@pengutronix.de>

On Wed, 5 Aug 2015 09:53:56 +0200
Sascha Hauer <s.hauer@pengutronix.de> wrote:

> On Wed, Aug 05, 2015 at 09:10:34AM +0300, Antony Pavlov wrote:
> > Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> > ---
> >  drivers/mtd/nand/nand_base.c | 14 +++++++-------
> >  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> Applied, thanks

It looks like I have to recall this patch.

+       if (IS_ENABLED(CONFIG_NAND_BBT)) {
+               if (!chip->bbt)
+                       return chip->block_bad(mtd, ofs, getchip);
+
+               /* Return info from the table */
+               return nand_isbad_bbt(mtd, ofs, allowbbt);
+       }

the nand_isbad_bbt() function is defined in drivers/mtd/nand/nand_bbt.c,
but nand_bbt.c is compiled-in only if CONFIG_NAND_BBT is enabled.

My current gcc-4.9.2-based toolchain has no problem with this,
but if CONFIG_NAND_BBT is disabled I suppose rather old toolchain can throw link error here.

I have to add something like this

#ifndef CONFIG_NAND_BBT

static inline nand_isbad_bbt(...) { };

#endif

to include/linux/mtd/nand.h.


-- 
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2015-08-05  8:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05  6:10 Antony Pavlov
2015-08-05  7:53 ` Sascha Hauer
2015-08-05  8:28   ` Antony Pavlov [this message]
2015-08-05  8:39     ` Sascha Hauer

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=20150805112844.d8fc268394120c97f6e62c5c@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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