From: Brian Norris <computersforpeace@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: angus.clark@st.com, kernel@stlinux.com,
Lee Jones <lee.jones@linaro.org>,
linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
dwmw2@infradead.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/5] mtd: st_spi_fsm: Remove useless consts from function arguments
Date: Thu, 20 Mar 2014 04:54:12 -0700 [thread overview]
Message-ID: <20140320115412.GU31517@norris-Latitude-E6410> (raw)
In-Reply-To: <1395316090.7776.24.camel@joe-AO722>
On Thu, Mar 20, 2014 at 04:48:10AM -0700, Joe Perches wrote:
> On Thu, 2014-03-20 at 11:41 +0000, Lee Jones wrote:
> > On Thu, 20 Mar 2014, Joe Perches wrote:
> > > On Thu, 2014-03-20 at 11:11 +0000, Lee Jones wrote:
> > > > Reported-by: Brian Norris <computersforpeace@gmail.com>
> > > > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > >
> > > Why are these useless?
> > >
> > > Even if the object code produced is the same,
> > > these serve as information to the human reader
> > > about how the arguments are used.
> >
> > https://lkml.org/lkml/2014/3/20/69
> >
>
> From that email:
>
> suggestion:
>
> const uint8_t *const buf => const uint8_t *buf
> const uint32_t size => uint32_t size
> const uint32_t offset => uint32_t offset
>
> What was done:
>
> -static int stfsm_write_fifo(struct stfsm *fsm,
> - const uint32_t *buf, const uint32_t size)
> +static int stfsm_write_fifo(struct stfsm *fsm, uint32_t *buf, uint32_t size)
>
> Note the removal of the const from uint32_t *buf
Good catch. That wasn't my intention.
> Why?
I can let Lee speak for himself. But I'm thinking I'll squash this diff
in, if no one minds:
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c
index bea1416aad07..1957d7c8e185 100644
--- a/drivers/mtd/devices/st_spi_fsm.c
+++ b/drivers/mtd/devices/st_spi_fsm.c
@@ -810,7 +810,8 @@ static void stfsm_read_fifo(struct stfsm *fsm, uint32_t *buf, uint32_t size)
}
}
-static int stfsm_write_fifo(struct stfsm *fsm, uint32_t *buf, uint32_t size)
+static int stfsm_write_fifo(struct stfsm *fsm, const uint32_t *buf,
+ uint32_t size)
{
uint32_t words = size >> 2;
@@ -1806,7 +1807,7 @@ out1:
return ret;
}
-static void stfsm_read_jedec(struct stfsm *fsm, uint8_t *const jedec)
+static void stfsm_read_jedec(struct stfsm *fsm, uint8_t *jedec)
{
const struct stfsm_seq *seq = &stfsm_seq_read_jedec;
uint32_t tmp[2];
next prev parent reply other threads:[~2014-03-20 11:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-20 11:11 [PATCH 0/5] mtd: st_spi_fsm: Sweep-up remaining blocking-issues Lee Jones
2014-03-20 11:11 ` [PATCH 1/5] mtd: st_spi_fsm: Remove useless consts from function arguments Lee Jones
2014-03-20 11:25 ` Joe Perches
2014-03-20 11:41 ` Lee Jones
2014-03-20 11:48 ` Joe Perches
2014-03-20 11:54 ` Brian Norris [this message]
2014-03-20 12:03 ` Lee Jones
2014-03-20 12:05 ` Brian Norris
2014-03-20 12:13 ` Joe Perches
2014-03-20 12:41 ` Brian Norris
2014-03-20 12:44 ` Joe Perches
2014-03-20 16:58 ` Brian Norris
2014-03-20 13:29 ` Lee Jones
2014-03-20 11:11 ` [PATCH 2/5] mtd: st_spi_fsm: Avoid duplicating MTD core code Lee Jones
2014-03-20 11:11 ` [PATCH 3/5] mtd: st_spi_fsm: Correct vendor name spelling issue - missing "M" Lee Jones
2014-03-20 11:11 ` [PATCH 4/5] mtd: st_spi_fsm: Allow loop to run at least once before giving up CPU Lee Jones
2014-03-20 11:11 ` [PATCH 5/5] mtd: st_spi_fsm: Succinctly reorganise .remove() Lee Jones
2014-03-20 11:29 ` [PATCH 0/5] mtd: st_spi_fsm: Sweep-up remaining blocking-issues Brian Norris
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=20140320115412.GU31517@norris-Latitude-E6410 \
--to=computersforpeace@gmail.com \
--cc=angus.clark@st.com \
--cc=dwmw2@infradead.org \
--cc=joe@perches.com \
--cc=kernel@stlinux.com \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--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