lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140320115412.GU31517@norris-Latitude-E6410>
Date:	Thu, 20 Mar 2014 04:54:12 -0700
From:	Brian Norris <computersforpeace@...il.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Lee Jones <lee.jones@...aro.org>,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	kernel@...inux.com, linux-mtd@...ts.infradead.org,
	dwmw2@...radead.org, angus.clark@...com
Subject: Re: [PATCH 1/5] mtd: st_spi_fsm: Remove useless consts from function
 arguments

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@...il.com>
> > > > Signed-off-by: Lee Jones <lee.jones@...aro.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@...il.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];
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ