From: mikedunn@newsguy•com (Mike Dunn)
To: linux-arm-kernel@lists•infradead.org
Subject: [RFC PATCH v2] MTD: nand: add return value for write_page()/write_page_raw() functions in structure of nand_ecc_ctrl.
Date: Thu, 21 Jun 2012 10:58:01 -0700 [thread overview]
Message-ID: <4FE360A9.4040102@newsguy.com> (raw)
In-Reply-To: <CAN8TOE8iDtzw4eTKa6tJ5oBxbaDUxg9nDLaKBhW4D86vGWxGJg@mail.gmail.com>
On 06/20/2012 11:43 AM, Brian Norris wrote:
>
> I noticed, for instance, that docg4.c has some strange code involving
> a return in a void function (comment below). If that is the *only*
> existing return statement within an 'ecc_ctrl.write_page'
> implmentation, then this whole patch is unneeded; you can just remove
> the 'return' in docg4.c.
>
>>> diff --git a/drivers/mtd/nand/docg4.c b/drivers/mtd/nand/docg4.c
>>> index a225e49..0f2ffd7 100644
>>> --- a/drivers/mtd/nand/docg4.c
>>> +++ b/drivers/mtd/nand/docg4.c
> ...
>>> -static void docg4_write_page_raw(struct mtd_info *mtd, struct nand_chip
>>> *nand,
>>> +static int docg4_write_page_raw(struct mtd_info *mtd, struct nand_chip
>>> *nand,
>>> const uint8_t *buf, int oob_required)
>>> {
>>> return write_page(mtd, nand, buf, false);
>>> }
>
> Hmm, this used to be a void function, returning the result of another
> void function? I would think the compiler would have warned about
> these issues before. Anyway, this is a useless 'return' statement and
> can be killed with no real effect.
Oops, yes, this must have been a careless mistake when I combined the read_page
and read_page_raw functions into one, with wrappers for each case. Oddly, no
compiler warning. I'm trying to get around to putting together a patch with a
couple minor fixes for the docg4, and I'll add this to the list.
Thanks Brian,
Mike
prev parent reply other threads:[~2012-06-21 17:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-13 6:06 [RFC PATCH v2] MTD: nand: add return value for write_page()/write_page_raw() functions in structure of nand_ecc_ctrl Josh Wu
2012-06-20 3:00 ` Josh Wu
2012-06-20 18:43 ` Brian Norris
2012-06-21 4:02 ` Josh Wu
2012-06-22 19:32 ` Brian Norris
2012-06-25 10:16 ` Josh Wu
2012-07-02 16:39 ` Brian Norris
2012-06-21 17:58 ` Mike Dunn [this message]
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=4FE360A9.4040102@newsguy.com \
--to=mikedunn@newsguy$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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