summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2018-05-02 19:03:38 +0200
committerCommit Bot <commit-bot@chromium.org>2021-04-20 14:25:28 +0000
commita273f8c9f161a792decb4746db0be32330727885 (patch)
treeaed051e25b8f0a1dfc4152a44a8fa68f523a7e38
parent6f18f739f21a2a34e4ba8b70d99c0f5e066b49f5 (diff)
downloadchrome-ec-a273f8c9f161a792decb4746db0be32330727885.tar.gz
Shuffle const around
gcc 8.1 complains about duplicate const, and while some of these really are duplicate, others look like they were supposed to tighten the API contract so that variables are "const pointer to const data", but didn't have that effect. BUG=b:65441143 BRANCH=none TEST=building Chrome EC as part of upstream coreboot's build with a gcc 8.1 compiler now works (better. there are other issues left) Change-Id: I6016c5f282516471746f08d5714ea07ebdd10331 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/1039812 Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@google.com> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit 85ddb2ce533cb0276aab7780238ec98e1abec2fe) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2723459 Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--chip/g/idle.c2
-rw-r--r--chip/npcx/flash.c2
-rw-r--r--common/console.c2
-rw-r--r--common/spi_flash.c2
-rw-r--r--core/cortex-m/task.c2
-rw-r--r--core/cortex-m0/task.c2
-rw-r--r--core/nds32/task.c2
-rw-r--r--include/als.h2
-rw-r--r--include/spi_flash.h2
9 files changed, 9 insertions, 9 deletions
diff --git a/chip/g/idle.c b/chip/g/idle.c
index f2bd6fe3bd..fd7ca46d8a 100644
--- a/chip/g/idle.c
+++ b/chip/g/idle.c
@@ -31,7 +31,7 @@ static enum {
static int idle_default;
-static const char const *idle_name[] = {
+static const char *const idle_name[] = {
"invalid",
"wfi",
"sleep",
diff --git a/chip/npcx/flash.c b/chip/npcx/flash.c
index 9c73bbdb3c..8cc6437a50 100644
--- a/chip/npcx/flash.c
+++ b/chip/npcx/flash.c
@@ -397,7 +397,7 @@ static void flash_burst_write(unsigned int dest_addr, unsigned int bytes,
}
static int flash_program_bytes(uint32_t offset, uint32_t bytes,
- const uint8_t const *data)
+ const uint8_t *data)
{
int write_size;
int rv;
diff --git a/common/console.c b/common/console.c
index 23562b00b5..eb09eb992a 100644
--- a/common/console.c
+++ b/common/console.c
@@ -149,7 +149,7 @@ static const struct console_command *find_command(char *name)
}
-static const char const *errmsgs[] = {
+static const char *const errmsgs[] = {
"OK",
"Unknown error",
"Unimplemented",
diff --git a/common/spi_flash.c b/common/spi_flash.c
index b9ba3538ac..2465a18830 100644
--- a/common/spi_flash.c
+++ b/common/spi_flash.c
@@ -275,7 +275,7 @@ int spi_flash_erase(unsigned int offset, unsigned int bytes)
* @return EC_SUCCESS, or non-zero if any error.
*/
int spi_flash_write(unsigned int offset, unsigned int bytes,
- const uint8_t const *data)
+ const uint8_t *data)
{
int rv, write_size;
diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c
index 4ba4bee112..a523234ff9 100644
--- a/core/cortex-m/task.c
+++ b/core/cortex-m/task.c
@@ -115,7 +115,7 @@ static const struct {
uint32_t r0;
uint32_t pc;
uint16_t stack_size;
-} const tasks_init[] = {
+} tasks_init[] = {
TASK(IDLE, __idle, 0, IDLE_TASK_STACK_SIZE)
CONFIG_TASK_LIST
CONFIG_TEST_TASK_LIST
diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c
index 019c7e005f..b63eb2b669 100644
--- a/core/cortex-m0/task.c
+++ b/core/cortex-m0/task.c
@@ -94,7 +94,7 @@ static const struct {
uint32_t r0;
uint32_t pc;
uint16_t stack_size;
-} const tasks_init[] = {
+} tasks_init[] = {
TASK(IDLE, __idle, 0, IDLE_TASK_STACK_SIZE)
CONFIG_TASK_LIST
CONFIG_TEST_TASK_LIST
diff --git a/core/nds32/task.c b/core/nds32/task.c
index 8fab6d1ef8..4515df36f4 100644
--- a/core/nds32/task.c
+++ b/core/nds32/task.c
@@ -109,7 +109,7 @@ static const struct {
uint32_t r0;
uint32_t pc;
uint16_t stack_size;
-} const tasks_init[] = {
+} tasks_init[] = {
TASK(IDLE, __idle, 0, IDLE_TASK_STACK_SIZE)
CONFIG_TASK_LIST
CONFIG_TEST_TASK_LIST
diff --git a/include/als.h b/include/als.h
index 89d1e06628..2f313fc63e 100644
--- a/include/als.h
+++ b/include/als.h
@@ -16,7 +16,7 @@ enum als_id;
/* Initialized in board.c */
struct als_t {
- const char const *name;
+ const char *const name;
int (*init)(void);
int (*read)(int *lux, int af);
int attenuation_factor;
diff --git a/include/spi_flash.h b/include/spi_flash.h
index 4e4dd96381..fd3e06a9bc 100644
--- a/include/spi_flash.h
+++ b/include/spi_flash.h
@@ -120,7 +120,7 @@ int spi_flash_erase(unsigned int offset, unsigned int bytes);
* @return EC_SUCCESS, or non-zero if any error.
*/
int spi_flash_write(unsigned int offset, unsigned int bytes,
- const uint8_t const *data);
+ const uint8_t *data);
/**
* Gets the SPI flash JEDEC ID (manufacturer ID, memory type, and capacity)