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]
Date:   Mon, 5 Aug 2019 10:25:41 +0000
From:   <Tudor.Ambarus@...rochip.com>
To:     <vigneshr@...com>, <miquel.raynal@...tlin.com>, <richard@....at>
CC:     <marek.vasut@...il.com>, <bbrezillon@...nel.org>,
        <linux-kernel@...r.kernel.org>, <linux-mtd@...ts.infradead.org>,
        <tmaimon77@...il.com>
Subject: Re: [PATCH v4 2/3] mtd: spi-nor: Move m25p80 code in spi-nor.c



On 08/01/2019 07:22 PM, Vignesh Raghavendra wrote:

> diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
> index e02376e1127b..866962c715b4 100644
> --- a/drivers/mtd/spi-nor/spi-nor.c
> +++ b/drivers/mtd/spi-nor/spi-nor.c
> @@ -19,6 +19,7 @@

cut

> +static ssize_t spi_nor_spimem_read_data(struct spi_nor *nor, loff_t from,
> +					size_t len, u8 *buf)
> +{
> +	struct spi_mem_op op =
> +		SPI_MEM_OP(SPI_MEM_OP_CMD(nor->read_opcode, 1),
> +			   SPI_MEM_OP_ADDR(nor->addr_width, from, 1),
> +			   SPI_MEM_OP_DUMMY(nor->read_dummy, 1),
> +			   SPI_MEM_OP_DATA_IN(len, buf, 1));
> +
> +	/* get transfer protocols. */
> +	op.cmd.buswidth = spi_nor_get_protocol_inst_nbits(nor->read_proto);
> +	op.addr.buswidth = spi_nor_get_protocol_addr_nbits(nor->read_proto);

nit: op.dummy.buswidth = op.addr.buswidth;

cut

>  
> @@ -688,6 +1003,16 @@ static int spi_nor_erase_sector(struct spi_nor *nor, u32 addr)
>  	if (nor->erase)
>  		return nor->erase(nor, addr);
>  
> +	if (nor->spimem) {
> +		struct spi_mem_op op =
> +			SPI_MEM_OP(SPI_MEM_OP_CMD(nor->erase_opcode, 1),
> +				   SPI_MEM_OP_ADDR(nor->addr_width, addr, 1),
> +				   SPI_MEM_OP_NO_DUMMY,
> +				   SPI_MEM_OP_NO_DATA);
> +
> +		return spi_mem_exec_op(nor->spimem, &op);
> +	}
> +

this should be done below in the function, after masking the address.

You add a double space after return in:
> +	return  nor->read_reg(nor, SPINOR_OP_RDSR2, sr2, 1);

There are some checkpatch warnings that we can fix now.

Looks good!
ta

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ