From a595a0e910960ccd4611719d5fb5c279859efaee Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 10 May 2020 11:39:53 -0600 Subject: flash: Tidy up coding style for flash functions Some functions use the wrong code style and generate checkpatch errors. Fix these. Signed-off-by: Simon Glass --- common/flash.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'common/flash.c') diff --git a/common/flash.c b/common/flash.c index 5f155aefd1d..9601716c3a2 100644 --- a/common/flash.c +++ b/common/flash.c @@ -24,7 +24,7 @@ extern flash_info_t flash_info[]; /* info for FLASH chips */ * If necessary you have to map the second bank at lower addresses. */ void -flash_protect (int flag, ulong from, ulong to, flash_info_t *info) +flash_protect(int flag, ulong from, ulong to, flash_info_t *info) { ulong b_end; short s_end; @@ -84,7 +84,7 @@ flash_protect (int flag, ulong from, ulong to, flash_info_t *info) */ flash_info_t * -addr2info (ulong addr) +addr2info(ulong addr) { flash_info_t *info; int i; @@ -119,12 +119,12 @@ addr2info (ulong addr) * (only some targets require alignment) */ int -flash_write (char *src, ulong addr, ulong cnt) +flash_write(char *src, ulong addr, ulong cnt) { int i; ulong end = addr + cnt - 1; - flash_info_t *info_first = addr2info (addr); - flash_info_t *info_last = addr2info (end ); + flash_info_t *info_first = addr2info(addr); + flash_info_t *info_last = addr2info(end); flash_info_t *info; __maybe_unused char *src_orig = src; __maybe_unused char *addr_orig = (char *)addr; -- cgit v1.2.3 From b79fdc76978515fba2c4f3b5b4f2e679c5ff1463 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 10 May 2020 11:39:54 -0600 Subject: common: Drop flash.h from common header Move this uncommon header out of the common header. Fix up some style problems in flash.h while we are here. Signed-off-by: Simon Glass --- common/flash.c | 1 + 1 file changed, 1 insertion(+) (limited to 'common/flash.c') diff --git a/common/flash.c b/common/flash.c index 9601716c3a2..4a28ac5d347 100644 --- a/common/flash.c +++ b/common/flash.c @@ -8,6 +8,7 @@ #include #include +#include #include -- cgit v1.2.3 From 09140113108541b95d340f3c7b6ee597d31ccc73 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 10 May 2020 11:40:03 -0600 Subject: command: Remove the cmd_tbl_t typedef We should not use typedefs in U-Boot. They cannot be used as forward declarations which means that header files must include the full header to access them. Drop the typedef and rename the struct to remove the _s suffix which is now not useful. This requires quite a few header-file additions. Signed-off-by: Simon Glass --- common/flash.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'common/flash.c') diff --git a/common/flash.c b/common/flash.c index 4a28ac5d347..cde648d4b88 100644 --- a/common/flash.c +++ b/common/flash.c @@ -39,10 +39,10 @@ flash_protect(int flag, ulong from, ulong to, flash_info_t *info) s_end = info->sector_count - 1; /* index of last sector */ b_end = info->start[0] + info->size - 1; /* bank end address */ - debug ("flash_protect %s: from 0x%08lX to 0x%08lX\n", - (flag & FLAG_PROTECT_SET) ? "ON" : - (flag & FLAG_PROTECT_CLEAR) ? "OFF" : "???", - from, to); + debug("%s %s: from 0x%08lX to 0x%08lX\n", __func__, + (flag & FLAG_PROTECT_SET) ? "ON" : + (flag & FLAG_PROTECT_CLEAR) ? "OFF" : "???", + from, to); /* There is nothing to do if we have no data about the flash * or the protect range and flash range don't overlap. -- cgit v1.2.3 From 3c7dded8e179ee213c8267c892720b84a7a59fd5 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 10 May 2020 11:40:04 -0600 Subject: Fix some checkpatch warnings in calls to debug() Fix up some incorrect code style in calls to functions in the log.h header, mostly debug(). Signed-off-by: Simon Glass --- common/flash.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common/flash.c') diff --git a/common/flash.c b/common/flash.c index cde648d4b88..115062a45cc 100644 --- a/common/flash.c +++ b/common/flash.c @@ -41,7 +41,7 @@ flash_protect(int flag, ulong from, ulong to, flash_info_t *info) debug("%s %s: from 0x%08lX to 0x%08lX\n", __func__, (flag & FLAG_PROTECT_SET) ? "ON" : - (flag & FLAG_PROTECT_CLEAR) ? "OFF" : "???", + (flag & FLAG_PROTECT_CLEAR) ? "OFF" : "???", from, to); /* There is nothing to do if we have no data about the flash @@ -67,7 +67,7 @@ flash_protect(int flag, ulong from, ulong to, flash_info_t *info) #else info->protect[i] = 0; #endif /* CONFIG_SYS_FLASH_PROTECTION */ - debug ("protect off %d\n", i); + debug("protect off %d\n", i); } else if (flag & FLAG_PROTECT_SET) { #if defined(CONFIG_SYS_FLASH_PROTECTION) @@ -75,7 +75,7 @@ flash_protect(int flag, ulong from, ulong to, flash_info_t *info) #else info->protect[i] = 1; #endif /* CONFIG_SYS_FLASH_PROTECTION */ - debug ("protect on %d\n", i); + debug("protect on %d\n", i); } } } -- cgit v1.2.3 From f7ae49fc4f363a803dab3be078e93ead8e75a8e9 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 10 May 2020 11:40:05 -0600 Subject: common: Drop log.h from common header Move this header out of the common header. Signed-off-by: Simon Glass --- common/flash.c | 1 + 1 file changed, 1 insertion(+) (limited to 'common/flash.c') diff --git a/common/flash.c b/common/flash.c index 115062a45cc..bb82385c1f7 100644 --- a/common/flash.c +++ b/common/flash.c @@ -8,6 +8,7 @@ #include #include +#include #include #include -- cgit v1.2.3