mtd: spi-nor: remove superfluous pass of nor->info->sector_size
Subsystems (2)
PATCH 1/1 mtd: spi-nor: remove superfluous pass of nor->info->sector_size
From: Tudor Ambarus <[email protected]>
We already pass a pointer to nor, we can obtain the sector_size by dereferencing it.
--- drivers/mtd/spi-nor/spi-nor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/mtd/spi-nor/spi-nor.c +3 -2
@@ -4257,11 +4257,12 @@ spi_nor_select_uniform_erase(struct spi_nor_erase_map *map,return erase; } -static int spi_nor_select_erase (struct spi_nor *nor,u32 wanted_size) +static int spi_nor_select_erase (struct spi_nor *nor) {struct spi_nor_erase_map *map = &nor->params.erase_map;const struct spi_nor_erase_type *erase =NULL ;struct mtd_info *mtd = &nor->mtd; +u32 wanted_size = nor->info->sector_size;int i;/*
@@ -4355,7 +4356,7 @@ static int spi_nor_default_setup(struct spi_nor *nor, }/* Select the Sector Erase command. */ - err =spi_nor_select_erase (nor, nor->info->sector_size); + err =spi_nor_select_erase (nor);if (err) {dev_err (nor->dev,"can't select erase settings supported by both the SPI controller and memory.\n" );
Signature · 1 line
2.9.5
Quoted 7 lines · On 28/08/19 4:05 PM, [email protected] wrote:
From: Tudor Ambarus <[email protected]>
We already pass a pointer to nor, we can obtain the
sector_sizeby dereferencing it.Signed-off-by Tudor Ambarus <[email protected]>---
Regards
Vignesh
Quoted 23 lines
drivers/mtd/spi-nor/spi-nor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/mtd/spi-nor/spi-nor.c +2
-1@@ -4257,11 +4257,12 @@ spi_nor_select_uniform_erase(struct spi_nor_erase_map *map,return erase; } -static int spi_nor_select_erase (struct spi_nor *nor,u32 wanted_size) +static int spi_nor_select_erase (struct spi_nor *nor) {struct spi_nor_erase_map *map = &nor->params.erase_map;const struct spi_nor_erase_type *erase =NULL ;struct mtd_info *mtd = &nor->mtd; +u32 wanted_size = nor->info->sector_size;int i;/*
drivers/mtd/spi-nor/spi-nor.c static int spi_nor_default_setup(struct spi_nor *nor, · line 4362
Quoted 8 lines
drivers/mtd/spi-nor/spi-nor.c +1
-1@@ -4355,7 +4356,7 @@ static int spi_nor_default_setup(struct spi_nor *nor, }/* Select the Sector Erase command. */ - err =spi_nor_select_erase (nor, nor->info->sector_size); + err =spi_nor_select_erase (nor);if (err) {dev_err (nor->dev,"can't select erase settings supported by both the SPI controller and memory.\n" );
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
[email protected]
AppliedQuoted 10 lines · On 08/28/2019 01:35 PM, Tudor Ambarus - M18064 wrote:
From: Tudor Ambarus <[email protected]>
We already pass a pointer to nor, we can obtain the
sector_sizeby dereferencing it.Signed-off-by Tudor Ambarus <[email protected]>--- drivers/mtd/spi-nor/spi-nor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git,
spi-nor/next branch.
Thanks,
ta