From 96b6bf92a393685b8a6e3edccca6df7bccd400c9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 2 May 2018 16:46:07 -0600 Subject: [PATCH] Cosmetic changes from review of last 2 PRs. --- configs/photon/src/stm32_rgbled.c | 27 +++++++++++++++++---------- drivers/sensors/ina3221.c | 18 +++++++++++------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/configs/photon/src/stm32_rgbled.c b/configs/photon/src/stm32_rgbled.c index b60c0a6803e..bfb8bc36362 100644 --- a/configs/photon/src/stm32_rgbled.c +++ b/configs/photon/src/stm32_rgbled.c @@ -151,8 +151,7 @@ int stm32_rgbled_setup(void) info.frequency = 100; -#ifdef CONFIG_PWM_MULTICHAN - +#ifdef CONFIG_PWM_MULTICHAN /* Setup the duty cycle and channel for red */ i = 0; @@ -174,7 +173,8 @@ int stm32_rgbled_setup(void) } /* Start the timer used for red, and any other colors that are - * sourced on a different channel of the same timer */ + * sourced on a different channel of the same timer. + */ ledr->ops->start(ledr, &info); @@ -184,21 +184,23 @@ int stm32_rgbled_setup(void) { info.channels[i].channel = 0; } - - /* If the green timer is not the same as the red timer, then set it up. */ + + /* If the green timer is not the same as the red timer, then set it + * up. + */ if (RGBLED_GPWMTIMER != RGBLED_RPWMTIMER) { i = 0; info.channels[i++].channel = RGBLED_GPWMCHANNEL; - + /* If the blue timer uses the same timer and the green */ if (RGBLED_GPWMTIMER == RGBLED_BPWMTIMER) { info.channels[i++].channel = RGBLED_BPWMCHANNEL; } - + /* Start green timer (and maybe blue) */ ledg->ops->start(ledg, &info); @@ -211,9 +213,12 @@ int stm32_rgbled_setup(void) } } - /* If the blue timer is different than the red and the green, it must be setup seperately */ + /* If the blue timer is different than the red and the green, it must + * be setup separately. + */ - if (RGBLED_BPWMTIMER != RGBLED_RPWMTIMER && RGBLED_BPWMTIMER != RGBLED_GPWMTIMER) + if (RGBLED_BPWMTIMER != RGBLED_RPWMTIMER && + RGBLED_BPWMTIMER != RGBLED_GPWMTIMER) { info.channels[0].channel = RGBLED_BPWMCHANNEL; ledb->ops->start(ledb, &info); @@ -228,7 +233,9 @@ int stm32_rgbled_setup(void) /* Register the RGB LED diver at "/dev/rgbled0" */ #ifdef CONFIG_PWM_MULTICHAN - ret = rgbled_register("/dev/rgbled0", ledr, ledg, ledb, RGBLED_RPWMCHANNEL, RGBLED_GPWMCHANNEL, RGBLED_BPWMCHANNEL); + ret = rgbled_register("/dev/rgbled0", ledr, ledg, ledb, + RGBLED_RPWMCHANNEL, RGBLED_GPWMCHANNEL, + RGBLED_BPWMCHANNEL); #else ret = rgbled_register("/dev/rgbled0", ledr, ledg, ledb); #endif diff --git a/drivers/sensors/ina3221.c b/drivers/sensors/ina3221.c index 3543f40919d..739df5f4c05 100644 --- a/drivers/sensors/ina3221.c +++ b/drivers/sensors/ina3221.c @@ -156,8 +156,8 @@ static const struct file_operations g_ina3221fops = ****************************************************************************/ static int ina3221_access(FAR struct ina3221_dev_s *priv, - uint8_t start_register_address, bool reading, - FAR uint8_t* register_value, uint8_t data_length) + uint8_t start_register_address, bool reading, + FAR uint8_t* register_value, uint8_t data_length) { struct i2c_msg_s msg[I2C_NOSTARTSTOP_MSGS]; int ret; @@ -185,7 +185,7 @@ static int ina3221_access(FAR struct ina3221_dev_s *priv, } static int ina3221_read16(FAR struct ina3221_dev_s *priv, uint8_t regaddr, - FAR uint16_t* regvalue) + FAR uint16_t* regvalue) { uint8_t buf[2]; @@ -200,7 +200,7 @@ static int ina3221_read16(FAR struct ina3221_dev_s *priv, uint8_t regaddr, } static int ina3221_write16(FAR struct ina3221_dev_s *priv, uint8_t regaddr, - FAR uint16_t regvalue) + FAR uint16_t regvalue) { uint8_t buf[2]; @@ -237,7 +237,8 @@ static int ina3221_readpower(FAR struct ina3221_dev_s *priv, { /* Read the raw bus voltage */ - ret = ina3221_read16(priv, (INA3221_REG_CH1_BUS_VOLTAGE << i), ®); + ret = ina3221_read16(priv, (INA3221_REG_CH1_BUS_VOLTAGE << i), + ®); if (ret < 0) { snerr("ERROR: ina3221_read16 failed: %d\n", ret); @@ -251,7 +252,8 @@ static int ina3221_readpower(FAR struct ina3221_dev_s *priv, /* Read the raw shunt voltage */ - ret = ina3221_read16(priv, (INA3221_REG_CH1_SHUNT_VOLTAGE << i), ®); + ret = ina3221_read16(priv, (INA3221_REG_CH1_SHUNT_VOLTAGE << i), + ®); if (ret < 0) { snerr("ERROR: ina3221_read16 failed: %d\n", ret); @@ -296,6 +298,7 @@ static int ina3221_open(FAR struct file *filep) FAR struct inode *inode = filep->f_inode; FAR struct ina3221_dev_s *priv = inode->i_private; + UNUSED(priv); return OK; } @@ -312,6 +315,7 @@ static int ina3221_close(FAR struct file *filep) FAR struct inode *inode = filep->f_inode; FAR struct ina3221_dev_s *priv = inode->i_private; + UNUSED(priv); return OK; } @@ -323,7 +327,7 @@ static ssize_t ina3221_read(FAR struct file *filep, FAR char *buffer, size_t buflen) { FAR struct inode *inode = filep->f_inode; - FAR struct ina3221_dev_s *priv = inode->i_private; + FAR struct ina3221_dev_s *priv = inode->i_private; FAR struct ina3221_s *ptr; ssize_t nsamples; int i;