summaryrefslogtreecommitdiff
path: root/common/cec.c
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2022-06-27 14:34:34 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-01 10:18:10 +0000
commit9e61f21ea31dfdadd710de3e0476da8daf85a5e0 (patch)
treea796070633bea21475a7f65427ee34e915ef3714 /common/cec.c
parent3df35c400b19625b65707fbefe44088ab7a9b19d (diff)
downloadchrome-ec-9e61f21ea31dfdadd710de3e0476da8daf85a5e0.tar.gz
common/cec.c: Format with clang-format
BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ic14c59460d83eb00f8ceb77661eb6512ccfff379 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729613 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'common/cec.c')
-rw-r--r--common/cec.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/common/cec.c b/common/cec.c
index 1bc3273c1d..c487e51b16 100644
--- a/common/cec.c
+++ b/common/cec.c
@@ -7,8 +7,8 @@
#include "console.h"
#include "task.h"
-#define CPRINTF(format, args...) cprintf(CC_CEC, format, ## args)
-#define CPRINTS(format, args...) cprints(CC_CEC, format, ## args)
+#define CPRINTF(format, args...) cprintf(CC_CEC, format, ##args)
+#define CPRINTS(format, args...) cprints(CC_CEC, format, ##args)
/*
* Mutex for the read-offset of the rx queue. Needed since the
@@ -75,7 +75,7 @@ int cec_rx_queue_push(struct cec_rx_queue *queue, const uint8_t *msg,
queue->buf[offset] = 0;
offset = (offset + 1) % CEC_RX_BUFFER_SIZE;
- for (i = 0 ; i < msg_len; i++) {
+ for (i = 0; i < msg_len; i++) {
if (offset == queue->read_offset) {
/* Buffer full */
return EC_ERROR_OVERFLOW;
@@ -101,8 +101,7 @@ int cec_rx_queue_push(struct cec_rx_queue *queue, const uint8_t *msg,
return EC_SUCCESS;
}
-int cec_rx_queue_pop(struct cec_rx_queue *queue, uint8_t *msg,
- uint8_t *msg_len)
+int cec_rx_queue_pop(struct cec_rx_queue *queue, uint8_t *msg, uint8_t *msg_len)
{
int i;
@@ -126,9 +125,8 @@ int cec_rx_queue_pop(struct cec_rx_queue *queue, uint8_t *msg,
queue->read_offset = (queue->read_offset + 1) % CEC_RX_BUFFER_SIZE;
for (i = 0; i < *msg_len; i++) {
msg[i] = queue->buf[queue->read_offset];
- queue->read_offset = (queue->read_offset + 1) %
- CEC_RX_BUFFER_SIZE;
-
+ queue->read_offset =
+ (queue->read_offset + 1) % CEC_RX_BUFFER_SIZE;
}
mutex_unlock(&rx_queue_readoffset_mutex);