common/virtual_battery.c: Format with clang-format
BRANCH=none
TEST=none
@@ -34,12 +34,10 @@ static uint8_t cache_hit;
static const uint8_t *batt_cmd_head;
static int acc_write_len;
-int virtual_battery_handler(struct ec_response_i2c_passthru *resp,
- int in_len, int *err_code, int xferflags,
- int read_len, int write_len,
- const uint8_t *out)
+int virtual_battery_handler(struct ec_response_i2c_passthru *resp, int in_len,
+ int *err_code, int xferflags, int read_len,
+ int write_len, const uint8_t *out)
{
-
#if defined(CONFIG_BATTERY_PRESENT_GPIO) || \
defined(CONFIG_BATTERY_PRESENT_CUSTOM)
/*
@@ -118,9 +116,7 @@ int virtual_battery_handler(struct ec_response_i2c_passthru *resp,
/* write to virtual battery */
case START:
case WRITE_VB:
- virtual_battery_operation(batt_cmd_head,
- NULL,
- 0,
+ virtual_battery_operation(batt_cmd_head, NULL, 0,
acc_write_len);
break;
/* read from virtual battery */
@@ -130,14 +126,12 @@ int virtual_battery_handler(struct ec_response_i2c_passthru *resp,
memset(&resp->data[0], 0, read_len);
virtual_battery_operation(batt_cmd_head,
&resp->data[0],
- read_len,
- 0);
+ read_len, 0);
}
break;
default:
reset_parse_state();
return EC_ERROR_INVAL;
-
}
/* Reset the state in the end of messages */
reset_parse_state();
@@ -166,7 +160,8 @@ void copy_memmap_string(uint8_t *dest, int offset, int len)
memmap_str = host_get_memmap(offset);
/* memmap_str might not be NULL terminated */
memmap_strlen = *(memmap_str + EC_MEMMAP_TEXT_MAX - 1) == '\0' ?
- strlen(memmap_str) : EC_MEMMAP_TEXT_MAX;
+ strlen(memmap_str) :
+ EC_MEMMAP_TEXT_MAX;
dest[0] = memmap_strlen;
memcpy(dest + 1, memmap_str, MIN(memmap_strlen, len - 1));
}
@@ -180,10 +175,8 @@ static void copy_battery_info_string(uint8_t *dst, const uint8_t *src, int len)
strncpy(dst + 1, src, len - 1);
}
-int virtual_battery_operation(const uint8_t *batt_cmd_head,
- uint8_t *dest,
- int read_len,
- int write_len)
+int virtual_battery_operation(const uint8_t *batt_cmd_head, uint8_t *dest,
+ int read_len, int write_len)
{
int val;
int year, month, day;
@@ -234,8 +227,7 @@ int virtual_battery_operation(const uint8_t *batt_cmd_head,
*/
batt_mode_cache =
MODE_INTERNAL_CHARGE_CONTROLLER |
- MODE_ALARM |
- MODE_CHARGER;
+ MODE_ALARM | MODE_CHARGER;
memcpy(dest, &batt_mode_cache, bounded_read_len);
}
