From: Mike Dunn <mikedunn@newsguy.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: bryan.wu@analog.com, jack.lan@freescale.com,
nick.spence@freescale.com, dedekind1@gmail.com,
dwmw2@infradead.org, Josh Wu <josh.wu@atmel.com>,
linux-mtd@lists.infradead.org, scottwood@freescale.com,
Dipen.Dudhat@freescale.com, tglx@linutronix.de,
tie-fei.zang@freescale.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [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
WARNING: multiple messages have this Message-ID (diff)
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
next prev parent reply other threads:[~2012-06-21 17:58 UTC|newest]
Thread overview: 16+ 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-13 6:06 ` Josh Wu
2012-06-20 3:00 ` Josh Wu
2012-06-20 3:00 ` Josh Wu
2012-06-20 18:43 ` Brian Norris
2012-06-20 18:43 ` Brian Norris
2012-06-21 4:02 ` Josh Wu
2012-06-21 4:02 ` Josh Wu
2012-06-22 19:32 ` Brian Norris
2012-06-22 19:32 ` Brian Norris
2012-06-25 10:16 ` Josh Wu
2012-06-25 10:16 ` Josh Wu
2012-07-02 16:39 ` Brian Norris
2012-07-02 16:39 ` Brian Norris
2012-06-21 17:58 ` Mike Dunn [this message]
2012-06-21 17:58 ` Mike Dunn
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.com \
--cc=Dipen.Dudhat@freescale.com \
--cc=bryan.wu@analog.com \
--cc=computersforpeace@gmail.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=jack.lan@freescale.com \
--cc=josh.wu@atmel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=nick.spence@freescale.com \
--cc=scottwood@freescale.com \
--cc=tglx@linutronix.de \
--cc=tie-fei.zang@freescale.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.