driver/battery/max17055.c: Format with clang-format
BRANCH=none
TEST=none
#define MAX17055_READ_DEBUG(offset, ptr_reg) \
do { \
if (max17055_read(offset, ptr_reg)) { \
- CPRINTS("%s: failed to read reg %02x", \
- __func__, offset); \
+ CPRINTS("%s: failed to read reg %02x", __func__, \
+ offset); \
return; \
} \
} while (0)
#define MAX17055_WRITE_DEBUG(offset, reg) \
do { \
if (max17055_write(offset, reg)) { \
- CPRINTS("%s: failed to read reg %02x", \
- __func__, offset); \
+ CPRINTS("%s: failed to read reg %02x", __func__, \
+ offset); \
return; \
} \
} while (0)
@@ -66,14 +66,12 @@ static int fake_state_of_charge = -1;
static int max17055_read(int offset, int *data)
{
- return i2c_read16(I2C_PORT_BATTERY, MAX17055_ADDR_FLAGS,
- offset, data);
+ return i2c_read16(I2C_PORT_BATTERY, MAX17055_ADDR_FLAGS, offset, data);
}
static int max17055_write(int offset, int data)
{
- return i2c_write16(I2C_PORT_BATTERY, MAX17055_ADDR_FLAGS,
- offset, data);
+ return i2c_write16(I2C_PORT_BATTERY, MAX17055_ADDR_FLAGS, offset, data);
}
/* Return 1 if the device id is correct. */
@@ -293,7 +291,8 @@ void battery_get_params(struct batt_params *batt)
batt_new.flags |= BATT_FLAG_BAD_STATE_OF_CHARGE;
batt_new.state_of_charge = fake_state_of_charge >= 0 ?
- fake_state_of_charge : PERCENTAGE_CONV(reg);
+ fake_state_of_charge :
+ PERCENTAGE_CONV(reg);
if (max17055_read(REG_VOLTAGE, &reg))
batt_new.flags |= BATT_FLAG_BAD_VOLTAGE;
@@ -319,8 +318,7 @@ void battery_get_params(struct batt_params *batt)
* and battery isn't full (and we read them all correctly).
*/
if (!(batt_new.flags & BATT_FLAG_BAD_STATE_OF_CHARGE) &&
- batt_new.desired_voltage &&
- batt_new.desired_current &&
+ batt_new.desired_voltage && batt_new.desired_current &&
batt_new.state_of_charge < BATTERY_LEVEL_FULL)
batt_new.flags |= BATT_FLAG_WANT_CHARGE;
