From: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
To: pekon <pekon@pek-sem.com>
Cc: "Brian Norris" <computersforpeace@gmail.com>,
"Tony Lindgren" <tony@atomide.com>,
linux-mtd@lists.infradead.org,
linux-omap <linux-omap@vger.kernel.org>,
"Guido Martínez" <guido@vanguardiasur.com.ar>,
"Roger Quadros" <rogerq@ti.com>
Subject: Re: [PATCH 2/3] nand: omap2: Remove horrible ifdefs to fix module probe
Date: Sat, 6 Sep 2014 18:47:11 -0300 [thread overview]
Message-ID: <20140906214711.GB20943@arch.cereza> (raw)
In-Reply-To: <540B785C.3070400@pek-sem.com>
On 07 Sep 02:40 AM, pekon wrote:
> + linux-omap, as this patch touches arch/arm/mach-omap2/gpmc.c
>
> Hi Ezequiel,
>
> On Sunday 07 September 2014 01:26 AM, Ezequiel Garcia wrote:
> >The current code abuses ifdefs to determine if the selected ECC scheme
> >is supported by the running kernel. As a result the code is hard to read,
> >and it also fails to load as a module.
> >
> >This commit removes all the ifdefs and instead introduces a function
> >omap2_nand_ecc_check() to check if the ECC is supported by using
> >IS_ENABLED(CONFIG_xxx).
> >
> Yup, true.
> Thanks for cleaning up OMAP2 NAND driver, but few feedbacks.
>
First of all, this is no cleaning. The driver fails to load as a module
over here. Unless I'm missed something, ifdef seemed false when CONFIG_xxx=m.
> Just for record, current version of omap2.c NAND driver has so
> many #ifdef because:
>
[..]
I can't think of any valid excuses for cluttering the code with ifdefs like
this. There are several ways of doing things cleaner, by grouping code
differently.
[..]
> >+ }
> >+ if (ecc_needs_elm && !is_elm_present(info, pdata->elm_of_node)) {
> >+ dev_err(&info->pdev->dev, "ELM not available\n");
> >+ return false;
> >+ }
> >+
> >+ return true;
> > }
>
> Actually this new function is not required.
[snip]
> If I'm not wrong, this is all you need in this patch
> empty functions for CONFIG_MTD_NAND_ECC_BCH exposed symbols are already
> handled in /include/linux/mtd/nand_bch.h
>
> So, after this change, you can most of #ifdefs and IS_ENABLED()
> and this patch should be simplified.
>
OK, I'll take a look. Thanks for the suggestion,
--
Ezequiel Garcia, VanguardiaSur
www.vanguardiasur.com.ar
WARNING: multiple messages have this Message-ID (diff)
From: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
To: pekon <pekon@pek-sem.com>
Cc: "Roger Quadros" <rogerq@ti.com>,
"Brian Norris" <computersforpeace@gmail.com>,
"Tony Lindgren" <tony@atomide.com>,
linux-mtd@lists.infradead.org,
"Guido Martínez" <guido@vanguardiasur.com.ar>,
linux-omap <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 2/3] nand: omap2: Remove horrible ifdefs to fix module probe
Date: Sat, 6 Sep 2014 18:47:11 -0300 [thread overview]
Message-ID: <20140906214711.GB20943@arch.cereza> (raw)
In-Reply-To: <540B785C.3070400@pek-sem.com>
On 07 Sep 02:40 AM, pekon wrote:
> + linux-omap, as this patch touches arch/arm/mach-omap2/gpmc.c
>
> Hi Ezequiel,
>
> On Sunday 07 September 2014 01:26 AM, Ezequiel Garcia wrote:
> >The current code abuses ifdefs to determine if the selected ECC scheme
> >is supported by the running kernel. As a result the code is hard to read,
> >and it also fails to load as a module.
> >
> >This commit removes all the ifdefs and instead introduces a function
> >omap2_nand_ecc_check() to check if the ECC is supported by using
> >IS_ENABLED(CONFIG_xxx).
> >
> Yup, true.
> Thanks for cleaning up OMAP2 NAND driver, but few feedbacks.
>
First of all, this is no cleaning. The driver fails to load as a module
over here. Unless I'm missed something, ifdef seemed false when CONFIG_xxx=m.
> Just for record, current version of omap2.c NAND driver has so
> many #ifdef because:
>
[..]
I can't think of any valid excuses for cluttering the code with ifdefs like
this. There are several ways of doing things cleaner, by grouping code
differently.
[..]
> >+ }
> >+ if (ecc_needs_elm && !is_elm_present(info, pdata->elm_of_node)) {
> >+ dev_err(&info->pdev->dev, "ELM not available\n");
> >+ return false;
> >+ }
> >+
> >+ return true;
> > }
>
> Actually this new function is not required.
[snip]
> If I'm not wrong, this is all you need in this patch
> empty functions for CONFIG_MTD_NAND_ECC_BCH exposed symbols are already
> handled in /include/linux/mtd/nand_bch.h
>
> So, after this change, you can most of #ifdefs and IS_ENABLED()
> and this patch should be simplified.
>
OK, I'll take a look. Thanks for the suggestion,
--
Ezequiel Garcia, VanguardiaSur
www.vanguardiasur.com.ar
next prev parent reply other threads:[~2014-09-06 21:48 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-06 19:56 [PATCH 0/3] nand: omap2: Two and a half improvements Ezequiel Garcia
2014-09-06 19:56 ` [PATCH 1/3] nand: omap2: Add support for a flash-based bad block table Ezequiel Garcia
2014-09-06 19:56 ` [PATCH 2/3] nand: omap2: Remove horrible ifdefs to fix module probe Ezequiel Garcia
2014-09-06 21:10 ` pekon
2014-09-06 21:10 ` pekon
2014-09-06 21:47 ` Ezequiel Garcia [this message]
2014-09-06 21:47 ` Ezequiel Garcia
2014-09-06 23:17 ` Ezequiel Garcia
2014-09-06 23:17 ` Ezequiel Garcia
2014-09-07 9:35 ` pekon
2014-09-07 9:35 ` pekon
2014-09-07 15:16 ` Ezequiel Garcia
2014-09-07 15:16 ` Ezequiel Garcia
2014-09-08 8:45 ` Roger Quadros
2014-09-08 10:53 ` Roger Quadros
2014-09-10 12:48 ` Ezequiel Garcia
2014-09-10 13:05 ` Roger Quadros
2014-09-17 8:33 ` Brian Norris
2014-09-17 9:54 ` Ezequiel Garcia
2014-09-18 2:54 ` Brian Norris
2014-09-10 20:15 ` pekon
2014-09-08 11:28 ` Ezequiel Garcia
2014-09-06 19:56 ` [PATCH 3/3] nand: omap2: Replace pr_err with dev_err Ezequiel Garcia
2014-09-08 8:30 ` [PATCH 0/3] nand: omap2: Two and a half improvements Roger Quadros
2014-09-08 11:31 ` Ezequiel Garcia
2014-09-08 11:47 ` Roger Quadros
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=20140906214711.GB20943@arch.cereza \
--to=ezequiel@vanguardiasur.com.ar \
--cc=computersforpeace@gmail.com \
--cc=guido@vanguardiasur.com.ar \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=pekon@pek-sem.com \
--cc=rogerq@ti.com \
--cc=tony@atomide.com \
/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.