summaryrefslogtreecommitdiff
path: root/chip/host/i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/host/i2c.c')
-rw-r--r--chip/host/i2c.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/chip/host/i2c.c b/chip/host/i2c.c
index ba4ab376d2..3fddbbbac5 100644
--- a/chip/host/i2c.c
+++ b/chip/host/i2c.c
@@ -1,4 +1,4 @@
-/* Copyright 2013 The Chromium OS Authors. All rights reserved.
+/* Copyright 2013 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
@@ -52,8 +52,7 @@ int test_attach_i2c(const int port, const uint16_t addr_flags)
int i;
for (i = 0; i < MAX_DETACHED_DEV_COUNT; ++i)
- if (detached_devs[i].valid &&
- detached_devs[i].port == port &&
+ if (detached_devs[i].valid && detached_devs[i].port == port &&
detached_devs[i].addr_flags == addr_flags)
break;
@@ -64,22 +63,19 @@ int test_attach_i2c(const int port, const uint16_t addr_flags)
return EC_SUCCESS;
}
-static int test_check_detached(const int port,
- const uint16_t addr_flags)
+static int test_check_detached(const int port, const uint16_t addr_flags)
{
int i;
for (i = 0; i < MAX_DETACHED_DEV_COUNT; ++i)
- if (detached_devs[i].valid &&
- detached_devs[i].port == port &&
+ if (detached_devs[i].valid && detached_devs[i].port == port &&
detached_devs[i].addr_flags == addr_flags)
return 1;
return 0;
}
-int chip_i2c_xfer(const int port, const uint16_t addr_flags,
- const uint8_t *out, int out_size,
- uint8_t *in, int in_size, int flags)
+int chip_i2c_xfer(const int port, const uint16_t addr_flags, const uint8_t *out,
+ int out_size, uint8_t *in, int in_size, int flags)
{
const struct test_i2c_xfer *p;
int rv;
@@ -87,9 +83,8 @@ int chip_i2c_xfer(const int port, const uint16_t addr_flags,
if (test_check_detached(port, addr_flags))
return EC_ERROR_UNKNOWN;
for (p = __test_i2c_xfer; p < __test_i2c_xfer_end; ++p) {
- rv = p->routine(port, addr_flags,
- out, out_size,
- in, in_size, flags);
+ rv = p->routine(port, addr_flags, out, out_size, in, in_size,
+ flags);
if (rv != EC_ERROR_INVAL)
return rv;
}