sf: eon|spansion|ramtron: Fix code cleanup
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/5 sf: eon|spansion|ramtron: Fix code cleanup
- line over 80 characters
- insert the expression in same line
Signed-off-by Jagannadha Sutradharudu Teki <[email protected]>
--- drivers/mtd/spi/eon.c | 3 +-- drivers/mtd/spi/ramtron.c | 6 ++++-- drivers/mtd/spi/spansion.c | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-)
drivers/mtd/spi/eon.c +1 -2
@@ -54,8 +54,7 @@ struct spi_flash *spi_flash_probe_eon(struct spi_slave *spi, u8 *idcode) flash->page_size =256 ; flash->sector_size =256 *16 *16 ; - flash->size =256 *16 - * params->nr_sectors; + flash->size =256 *16 * params->nr_sectors;return flash; }
drivers/mtd/spi/ramtron.c +4 -2
@@ -246,7 +246,8 @@ struct spi_flash *spi_fram_probe_ramtron(struct spi_slave *spi, u8 *idcode)/* JEDEC conformant RAMTRON id */ for (i =0 ; i <ARRAY_SIZE (ramtron_spi_fram_table); i++) { params = &ramtron_spi_fram_table[i]; -if (idcode[1 ] == params->id1 && idcode[2 ] == params->id2) +if (idcode[1 ] == params->id1 && + idcode[2 ] == params->id2) goto found; }break ;
@@ -267,7 +268,8 @@ struct spi_flash *spi_fram_probe_ramtron(struct spi_slave *spi, u8 *idcode)/* now find the device */ for (i =0 ; i <ARRAY_SIZE (ramtron_spi_fram_table); i++) { params = &ramtron_spi_fram_table[i]; -if (!strcmp (params->name,CONFIG_SPI_FRAM_RAMTRON_NON_JEDEC )) +if (!strcmp (params->name, +CONFIG_SPI_FRAM_RAMTRON_NON_JEDEC )) goto found; } debug("SF: Unsupported non-JEDEC RAMTRON device "
drivers/mtd/spi/spansion.c +2 -1
@@ -131,7 +131,8 @@ struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode) }if (i ==ARRAY_SIZE (spansion_spi_flash_table)) { -debug ("SF: Unsupported SPANSION ID %04x %04x\n" , jedec, ext_jedec); +debug ("SF: Unsupported SPANSION ID %04x %04x\n" , + jedec, ext_jedec);return NULL ; }
Signature · 1 line
1.7.4
PATCH 2/5 sf: sst: Fix code cleanup
In reply to a message not in the archive- line over 80 characters
- add spaces
- add tabs
Signed-off-by Jagannadha Sutradharudu Teki <[email protected]>
--- drivers/mtd/spi/sst.c | 32 ++++++++++++++++++++------------ 1 files changed, 20 insertions(+), 12 deletions(-)
drivers/mtd/spi/sst.c +20 -12
@@ -19,7 +19,7 @@#include "spi_flash_internal.h" #define CMD_SST_BP 0x02/* Byte Program */ -#define CMD_SST_AAI_WP 0xAD/* Auto Address Increment Word Program */ +#define CMD_SST_AAI_WP 0xAD/* Auto Address Incr Word Program */ #define SST_SR_WIP (1 << 0)/* Write-in-Progress */ #define SST_SR_WEL (1 << 1)/* Write enable */
@@ -50,42 +50,50 @@ static const struct sst_spi_flash_params sst_spi_flash_table[] = { .flags = SST_FEAT_WP, .nr_sectors = 128, .name = "SST25VF040B", - },{ + }, + { .idcode1 = 0x8e, .flags = SST_FEAT_WP, .nr_sectors = 256, .name = "SST25VF080B", - },{ + }, + { .idcode1 = 0x41, .flags = SST_FEAT_WP, .nr_sectors = 512, .name = "SST25VF016B", - },{ + }, + { .idcode1 = 0x4a, .flags = SST_FEAT_WP, .nr_sectors = 1024, .name = "SST25VF032B", - },{ + }, + { .idcode1 = 0x4b, .flags = SST_FEAT_MBP, .nr_sectors = 2048, .name = "SST25VF064C", - },{ + }, + { .idcode1 = 0x01, .flags = SST_FEAT_WP, .nr_sectors = 16, .name = "SST25WF512", - },{ + }, + { .idcode1 = 0x02, .flags = SST_FEAT_WP, .nr_sectors = 32, .name = "SST25WF010", - },{ + }, + { .idcode1 = 0x03, .flags = SST_FEAT_WP, .nr_sectors = 64, .name = "SST25WF020", - },{ + }, + { .idcode1 = 0x04, .flags = SST_FEAT_WP, .nr_sectors = 128,
@@ -152,11 +160,11 @@ sst_write_wp(struct spi_flash *flash, u32 offset, size_t len, const void *buf)for (; actual < len -1 ; actual +=2 ) {debug ("WP[%02x]: 0x%p => cmd = { 0x%02x 0x%06x }\n" , -spi_w8r8 (flash->spi,CMD_READ_STATUS ), buf + actual, cmd[0 ], - offset); +spi_w8r8 (flash->spi,CMD_READ_STATUS ), buf + actual, + cmd[0 ], offset); ret =spi_flash_cmd_write (flash->spi, cmd, cmd_len, - buf + actual,2 ); + buf + actual,2 );if (ret) {debug ("SF: sst word program failed\n" );break ;
Signature · 1 line
1.7.4
PATCH 3/5 sf: stmicro: Fix code cleanup
In reply to a message not in the archive- line over 80 characters
- foo * bar -> foo *bar
- removed unnecessary for single statement blocks.
Signed-off-by Jagannadha Sutradharudu Teki <[email protected]>
--- drivers/mtd/spi/stmicro.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/mtd/spi/stmicro.c +3 -4
@@ -34,7 +34,7 @@#include "spi_flash_internal.h" /* M25Pxx-specific commands */ -#define CMD_M25PXX_RES 0xab/* Release from DP, and Read Signature */ +#define CMD_M25PXX_RES 0xab/* Release from DP, and Read Signature */ struct stmicro_spi_flash_params {u16 id;
@@ -142,7 +142,7 @@ static const struct stmicro_spi_flash_params stmicro_spi_flash_table[] = { }, }; -struct spi_flash *spi_flash_probe_stmicro (struct spi_slave *spi,u8 * idcode) +struct spi_flash *spi_flash_probe_stmicro (struct spi_slave *spi,u8 *idcode) {const struct stmicro_spi_flash_params *params;struct spi_flash *flash;
@@ -166,9 +166,8 @@ struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)for (i =0 ; i <ARRAY_SIZE (stmicro_spi_flash_table); i++) { params = &stmicro_spi_flash_table[i]; -if (params->id == id) { +if (params->id == id)break ; - } }if (i ==ARRAY_SIZE (stmicro_spi_flash_table)) {
Signature · 1 line
1.7.4
PATCH 4/5 sf: Fix line over 80 chars cleanup
In reply to a message not in the archiveCode cleanup line over 80 characters.
Signed-off-by Jagannadha Sutradharudu Teki <[email protected]>
--- drivers/mtd/spi/spi_flash.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
drivers/mtd/spi/spi_flash.c +6 -3
@@ -42,7 +42,8 @@ static int spi_flash_read_write(struct spi_slave *spi,debug ("SF: Failed to send command (%zu bytes): %d\n" , cmd_len, ret); }else if (data_len !=0 ) { - ret =spi_xfer (spi, data_len *8 , data_out, data_in,SPI_XFER_END ); + ret =spi_xfer (spi, data_len *8 , data_out, data_in, +SPI_XFER_END );if (ret)debug ("SF: Failed to transfer %zu bytes of data: %d\n" , data_len, ret);
@@ -239,11 +240,13 @@ int spi_flash_cmd_erase(struct spi_flash *flash, u32 offset, size_t len)if (ret) goto out; - ret =spi_flash_cmd_write (flash->spi, cmd,sizeof (cmd),NULL ,0 ); + ret =spi_flash_cmd_write (flash->spi, cmd,sizeof (cmd), +NULL ,0 );if (ret) goto out; - ret =spi_flash_cmd_wait_ready (flash,SPI_FLASH_PAGE_ERASE_TIMEOUT ); + ret =spi_flash_cmd_wait_ready (flash, +SPI_FLASH_PAGE_ERASE_TIMEOUT );if (ret) goto out; }
Signature · 1 line
1.7.4
PATCH 5/5 cmd_sf: Fix code cleanup
In reply to a message not in the archive- line over 80 characters
- add tabs
Signed-off-by Jagannadha Sutradharudu Teki <[email protected]>
--- common/cmd_sf.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
common/cmd_sf.c +3 -2
@@ -468,7 +468,8 @@ static int do_spi_flash_test(int argc, char * const argv[]) }#endif /* CONFIG_CMD_SF_TEST */ -static int do_spi_flash (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) +static int do_spi_flash (cmd_tbl_t *cmdtp,int flag,int argc, +char *const argv[]) {const char *cmd;int ret;
@@ -524,7 +525,7 @@ U_BOOT_CMD("SPI flash sub-system" ,"probe [[bus:]cs] [hz] [mode] - init flash device on given SPI bus\n" " and chip select\n" -"sf read addr offset len - read `len' bytes starting at\n" +"sf read addr offset len - read `len' bytes starting at\n" " `offset' to memory at `addr'\n" "sf write addr offset len - write `len' bytes from memory\n" " at `addr' to flash at `offset'\n"
Signature · 1 line
1.7.4