summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorLouis Yung-Chieh Lo <yjlou@chromium.org>2014-05-02 12:22:24 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-05-07 03:41:22 +0000
commit4ba7a1502dabc4728d8e68572642dafafbd54692 (patch)
treef6183dfe771668a3c3aa77b42c3002af17dd9235 /common
parent58c50a970ab7df4f0e3f1b188e6b1966a9d47d1d (diff)
downloadchrome-ec-4ba7a1502dabc4728d8e68572642dafafbd54692.tar.gz
cleanup: add square brackets to make test parser easier
This may not contain all. I filtered out possible code by the following command: find . -name "*.h*" -o -name "*.c*" | xargs grep -n CPRINTF | \ grep -v "\[" | grep -v define | less BUG=none BRANCH=none TEST=make buildall tuntests Change-Id: I674f84f5966b34aeb8d4321d22629b450627a120 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/197997
Diffstat (limited to 'common')
-rw-r--r--common/button.c2
-rw-r--r--common/hooks.c2
-rw-r--r--common/i2c.c4
-rw-r--r--common/keyboard_mkbp.c2
-rw-r--r--common/keyboard_scan.c3
-rw-r--r--common/pmu_tps65090.c2
-rw-r--r--common/pmu_tps65090_charger.c2
-rw-r--r--common/usb_pd_protocol.c34
8 files changed, 27 insertions, 24 deletions
diff --git a/common/button.c b/common/button.c
index 32f2bd255b..ea17cea88f 100644
--- a/common/button.c
+++ b/common/button.c
@@ -44,7 +44,7 @@ static void button_init(void)
{
int i;
- CPRINTF("[%T (re)initializing buttons and interrupts.]\n");
+ CPRINTF("[%T (re)initializing buttons and interrupts]\n");
next_deferred_time = 0;
for (i = 0; i < CONFIG_BUTTON_COUNT; i++) {
state[i].debounced_pressed = raw_button_pressed(&buttons[i]);
diff --git a/common/hooks.c b/common/hooks.c
index 3d6ccb695f..b7086a866b 100644
--- a/common/hooks.c
+++ b/common/hooks.c
@@ -83,7 +83,7 @@ static void record_hook_delay(uint64_t now, uint64_t last, uint64_t interval,
/* Warn if delayed by more than 10% */
if (delayed * 10 > interval)
- CPRINTF("Hook at interval %d us delayed by %d us\n",
+ CPRINTF("[%T Hook at interval %d us delayed by %d us]\n",
(uint32_t)interval, (uint32_t)delayed);
}
#endif
diff --git a/common/i2c.c b/common/i2c.c
index 8667bff1cf..e90644e51a 100644
--- a/common/i2c.c
+++ b/common/i2c.c
@@ -269,7 +269,7 @@ int i2c_unwedge(int port)
* If we get here, a slave is holding the clock low and there
* is nothing we can do.
*/
- CPRINTF("[%T I2C unwedge failed, SCL is being held low.]\n");
+ CPRINTF("[%T I2C unwedge failed, SCL is being held low]\n");
ret = EC_ERROR_UNKNOWN;
goto unwedge_done;
}
@@ -277,7 +277,7 @@ int i2c_unwedge(int port)
if (i2c_raw_get_sda(port))
goto unwedge_done;
- CPRINTF("[%T I2C unwedge called with SDA held low.]\n");
+ CPRINTF("[%T I2C unwedge called with SDA held low]\n");
/* Keep trying to unwedge the SDA line until we run out of attempts. */
for (i = 0; i < UNWEDGE_SDA_ATTEMPTS; i++) {
diff --git a/common/keyboard_mkbp.c b/common/keyboard_mkbp.c
index d5343cdf36..4b1f479d5f 100644
--- a/common/keyboard_mkbp.c
+++ b/common/keyboard_mkbp.c
@@ -111,7 +111,7 @@ void keyboard_clear_buffer(void)
{
int i;
- CPRINTF("clearing keyboard fifo\n");
+ CPRINTF("[clearing keyboard fifo]\n");
kb_fifo_start = 0;
kb_fifo_end = 0;
diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c
index 6214f0934e..9007f4dff6 100644
--- a/common/keyboard_scan.c
+++ b/common/keyboard_scan.c
@@ -438,13 +438,14 @@ static int check_keys_changed(uint8_t *state)
#ifdef PRINT_SCAN_TIMES
/* Print delta times from now back to each previous scan */
+ CPRINTF("[%T kb deltaT");
for (i = 0; i < SCAN_TIME_COUNT; i++) {
int tnew = scan_time[
(SCAN_TIME_COUNT + scan_time_index - i) %
SCAN_TIME_COUNT];
CPRINTF(" %d", tnow - tnew);
}
- CPRINTF("\n");
+ CPRINTF("]\n");
#endif
/* Swallow special keys */
diff --git a/common/pmu_tps65090.c b/common/pmu_tps65090.c
index cf075c62d0..05b446eb4c 100644
--- a/common/pmu_tps65090.c
+++ b/common/pmu_tps65090.c
@@ -153,7 +153,7 @@ static int pmu_get_event(int *event)
*event = irq1 | (irq2 << 8);
if (prev_event != *event) {
- CPRINTF("pmu event: %016b\n", *event);
+ CPRINTF("[%T pmu event: %016b]\n", *event);
prev_event = *event;
}
diff --git a/common/pmu_tps65090_charger.c b/common/pmu_tps65090_charger.c
index 69ce2a9c26..374371a109 100644
--- a/common/pmu_tps65090_charger.c
+++ b/common/pmu_tps65090_charger.c
@@ -573,6 +573,6 @@ DECLARE_HOOK(HOOK_CHIPSET_RESUME, pmu_chipset_events, HOOK_PRIO_DEFAULT);
void pmu_irq_handler(enum gpio_signal signal)
{
pmu_task_throttled_wake();
- CPRINTF("Charger IRQ received.\n");
+ CPRINTF("[%T Charger IRQ received]\n");
}
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index eee328f046..08381dcf2f 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -312,13 +312,14 @@ static int send_validate_message(void *ctxt, uint16_t header, uint8_t cnt,
udelay(10);
return bit_len;
} else {
- /* CPRINTF("ERR ACK/%d %04x\n", id, head); */
+ /* CPRINTF("[%T PD ERR ACK/%d %04x]\n",
+ id, head); */
}
}
}
/* we failed all the re-transmissions */
/* TODO: try HardReset */
- CPRINTF("TX NO ACK %04x/%d\n", header, cnt);
+ CPRINTF("[%T PD TX NO ACK %04x/%d]\n", header, cnt);
return -1;
}
@@ -329,7 +330,7 @@ static int send_control(void *ctxt, int type)
bit_len = send_validate_message(ctxt, header, 0, NULL);
- CPRINTF("CTRL[%d]>%d\n", type, bit_len);
+ CPRINTF("[%T PD CTRL[%d]>%d]\n", type, bit_len);
return bit_len;
}
@@ -351,7 +352,7 @@ static int send_source_cap(void *ctxt)
bit_len = send_validate_message(ctxt, header, pd_src_pdo_cnt,
pd_src_pdo);
- CPRINTF("srcCAP>%d\n", bit_len);
+ CPRINTF("[%T PD srcCAP>%d]\n", bit_len);
return bit_len;
}
@@ -365,7 +366,7 @@ static void send_sink_cap(void *ctxt)
bit_len = send_validate_message(ctxt, header, pd_snk_pdo_cnt,
pd_snk_pdo);
- CPRINTF("snkCAP>%d\n", bit_len);
+ CPRINTF("[%T PD snkCAP>%d]\n", bit_len);
}
static int send_request(void *ctxt, uint32_t rdo)
@@ -374,7 +375,7 @@ static int send_request(void *ctxt, uint32_t rdo)
uint16_t header = PD_HEADER(PD_DATA_REQUEST, pd_role, pd_message_id, 1);
bit_len = send_validate_message(ctxt, header, 1, &rdo);
- CPRINTF("REQ%d>\n", bit_len);
+ CPRINTF("[%T PD REQ%d>]\n", bit_len);
return bit_len;
}
@@ -387,14 +388,14 @@ static int send_bist(void *ctxt)
uint16_t header = PD_HEADER(PD_DATA_BIST, pd_role, pd_message_id, 1);
bit_len = send_validate_message(ctxt, header, 1, &bdo);
- CPRINTF("BIST>%d\n", bit_len);
+ CPRINTF("[%T PD BIST>%d]\n", bit_len);
return bit_len;
}
static void handle_vdm_request(void *ctxt, int cnt, uint32_t *payload)
{
- CPRINTF("Unhandled VDM VID %04x CMD %04x\n", payload[0] >> 16,
+ CPRINTF("[%T PD Unhandled VDM VID %04x CMD %04x]\n", payload[0] >> 16,
payload[0] & 0xFFFF);
}
@@ -438,7 +439,7 @@ static void handle_data_request(void *ctxt, uint16_t head, uint32_t *payload)
send_control(ctxt, PD_CTRL_REJECT);
break;
case PD_DATA_BIST:
- CPRINTF("BIST not supported\n");
+ CPRINTF("[%T PD BIST not supported]\n");
break;
case PD_DATA_SINK_CAP:
break;
@@ -446,7 +447,7 @@ static void handle_data_request(void *ctxt, uint16_t head, uint32_t *payload)
handle_vdm_request(ctxt, cnt, payload);
break;
default:
- CPRINTF("Unhandled data message type %d\n", type);
+ CPRINTF("[%T PD unhandled data message type %d]\n", type);
}
}
@@ -484,7 +485,7 @@ static void handle_ctrl_request(void *ctxt, uint16_t head, uint32_t *payload)
case PD_CTRL_WAIT:
case PD_CTRL_SOFT_RESET:
default:
- CPRINTF("Unhandled ctrl message type %d\n", type);
+ CPRINTF("[%T PD unhandled ctrl message type %d]\n", type);
}
}
@@ -497,10 +498,10 @@ static void handle_request(void *ctxt, uint16_t head, uint32_t *payload)
send_goodcrc(ctxt, PD_HEADER_ID(head));
/* dump received packet content */
- CPRINTF("RECV %04x/%d ", head, cnt);
+ CPRINTF("[%T PD RECV %04x/%d ", head, cnt);
for (p = 0; p < cnt; p++)
CPRINTF("[%d]%08x ", p, payload[p]);
- CPRINTF("\n");
+ CPRINTF("]\n");
if (cnt)
handle_data_request(ctxt, head, payload);
@@ -590,7 +591,8 @@ static int analyze_rx(uint32_t *payload)
msg = "CRC";
if (pcrc != ccrc)
bit = PD_ERR_CRC;
- /* DEBUG */CPRINTF("CRC %08x <> %08x\n", pcrc, crc32_result());
+ /* DEBUG */
+ CPRINTF("[%T PD CRC %08x <> %08x]\n", pcrc, crc32_result());
goto packet_err;
}
@@ -608,7 +610,7 @@ packet_err:
if (debug_dump)
pd_dump_packet(ctxt, msg);
else
- CPRINTF("RX ERR (%d)\n", bit);
+ CPRINTF("[%T PD RX ERR (%d)]\n", bit);
return bit;
}
@@ -622,7 +624,7 @@ static void execute_hard_reset(void)
pd_task_state = PD_STATE_SRC_DISCONNECTED;
#endif
pd_power_supply_reset();
- CPRINTF("HARD RESET!\n");
+ CPRINTF("[%T PD HARD RESET!]\n");
}
void pd_task(void)