* [PATCH v2 0/9] staging: iio: adc: fix multiple checkpatch issues
@ 2015-10-07 18:13 Ioana Ciornei
2015-10-07 18:13 ` [PATCH v2 1/9] staging: iio: adc: use kernel types u32 and u64 Ioana Ciornei
` (8 more replies)
0 siblings, 9 replies; 17+ messages in thread
From: Ioana Ciornei @ 2015-10-07 18:13 UTC (permalink / raw)
To: outreachy-kernel; +Cc: Ioana Ciornei
This patchset fixes multiple checkpatch issues.
Patch 2/10 introduces some lines over 800 characters, thus some other checkpatch
warnings, but the readability of the entire core is improved by aligning the
arguments and the parameters of the functions to match the open bracket.
Changes in v2:
- removed commit 09/10 from previous version since it introduced build
warnings
Ioana Ciornei (9):
staging: iio: adc: use kernel types u32 and u64
staging: iio: adc: properly indent to match open paranthesis
staging: iio: adc: remove explicit comparison to NULL
staging: iio: adc: remove space after cast
staging: iio: adc: add spaces around binary operators
staging: iio: adc: add blank line after declarations
staging: iio: adc: remove multiple blank lines
staging: iio: adc: remove the use of CamelCase
staging: iio: adc: properly indent block comments
drivers/staging/iio/adc/ad7192.c | 91 +++++++++--------
drivers/staging/iio/adc/ad7192.h | 2 +-
drivers/staging/iio/adc/ad7280a.c | 186 +++++++++++++++++-----------------
drivers/staging/iio/adc/ad7606_core.c | 21 ++--
drivers/staging/iio/adc/ad7606_par.c | 15 +--
drivers/staging/iio/adc/ad7606_spi.c | 5 +-
drivers/staging/iio/adc/ad7780.c | 9 +-
drivers/staging/iio/adc/ad7816.c | 53 +++++-----
drivers/staging/iio/adc/lpc32xx_adc.c | 20 ++--
drivers/staging/iio/adc/mxs-lradc.c | 168 +++++++++++++++---------------
drivers/staging/iio/adc/spear_adc.c | 4 +-
11 files changed, 290 insertions(+), 284 deletions(-)
--
2.1.4
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH v2 1/9] staging: iio: adc: use kernel types u32 and u64 2015-10-07 18:13 [PATCH v2 0/9] staging: iio: adc: fix multiple checkpatch issues Ioana Ciornei @ 2015-10-07 18:13 ` Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 2/9] staging: iio: adc: properly indent to match open paranthesis Ioana Ciornei ` (7 subsequent siblings) 8 siblings, 0 replies; 17+ messages in thread From: Ioana Ciornei @ 2015-10-07 18:13 UTC (permalink / raw) To: outreachy-kernel; +Cc: Ioana Ciornei Convert uint32_t to u32 and uint64_t to u64 in order to follow the kernel best practice Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> --- Changes in v2: - nothing drivers/staging/iio/adc/mxs-lradc.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c index 3f7715c..d88d85b 100644 --- a/drivers/staging/iio/adc/mxs-lradc.c +++ b/drivers/staging/iio/adc/mxs-lradc.c @@ -108,12 +108,12 @@ static const char * const mx28_lradc_irq_names[] = { struct mxs_lradc_of_config { const int irq_count; const char * const *irq_name; - const uint32_t *vref_mv; + const u32 *vref_mv; }; #define VREF_MV_BASE 1850 -static const uint32_t mx23_vref_mv[LRADC_MAX_TOTAL_CHANS] = { +static const u32 mx23_vref_mv[LRADC_MAX_TOTAL_CHANS] = { VREF_MV_BASE, /* CH0 */ VREF_MV_BASE, /* CH1 */ VREF_MV_BASE, /* CH2 */ @@ -132,7 +132,7 @@ static const uint32_t mx23_vref_mv[LRADC_MAX_TOTAL_CHANS] = { VREF_MV_BASE * 4, /* CH15 VDD5V */ }; -static const uint32_t mx28_vref_mv[LRADC_MAX_TOTAL_CHANS] = { +static const u32 mx28_vref_mv[LRADC_MAX_TOTAL_CHANS] = { VREF_MV_BASE, /* CH0 */ VREF_MV_BASE, /* CH1 */ VREF_MV_BASE, /* CH2 */ @@ -198,14 +198,14 @@ struct mxs_lradc { struct clk *clk; - uint32_t *buffer; + u32 *buffer; struct iio_trigger *trig; struct mutex lock; struct completion completion; - const uint32_t *vref_mv; + const u32 *vref_mv; struct mxs_lradc_scale scale_avail[LRADC_MAX_TOTAL_CHANS][2]; unsigned long is_divided; @@ -1138,8 +1138,8 @@ static irqreturn_t mxs_lradc_handle_irq(int irq, void *data) struct iio_dev *iio = data; struct mxs_lradc *lradc = iio_priv(iio); unsigned long reg = readl(lradc->base + LRADC_CTRL1); - uint32_t clr_irq = mxs_lradc_irq_mask(lradc); - const uint32_t ts_irq_mask = + u32 clr_irq = mxs_lradc_irq_mask(lradc); + const u32 ts_irq_mask = LRADC_CTRL1_TOUCH_DETECT_IRQ | LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL1) | LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL2); @@ -1175,7 +1175,7 @@ static irqreturn_t mxs_lradc_trigger_handler(int irq, void *p) struct iio_poll_func *pf = p; struct iio_dev *iio = pf->indio_dev; struct mxs_lradc *lradc = iio_priv(iio); - const uint32_t chan_value = LRADC_CH_ACCUMULATE | + const u32 chan_value = LRADC_CH_ACCUMULATE | ((LRADC_DELAY_TIMER_LOOP - 1) << LRADC_CH_NUM_SAMPLES_OFFSET); unsigned int i, j = 0; @@ -1198,7 +1198,7 @@ static int mxs_lradc_configure_trigger(struct iio_trigger *trig, bool state) { struct iio_dev *iio = iio_trigger_get_drvdata(trig); struct mxs_lradc *lradc = iio_priv(iio); - const uint32_t st = state ? STMP_OFFSET_REG_SET : STMP_OFFSET_REG_CLR; + const u32 st = state ? STMP_OFFSET_REG_SET : STMP_OFFSET_REG_CLR; mxs_lradc_reg_wrt(lradc, LRADC_DELAY_KICK, LRADC_DELAY(0) + st); @@ -1248,10 +1248,10 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio) struct mxs_lradc *lradc = iio_priv(iio); int ret = 0, chan, ofs = 0; unsigned long enable = 0; - uint32_t ctrl4_set = 0; - uint32_t ctrl4_clr = 0; - uint32_t ctrl1_irq = 0; - const uint32_t chan_value = LRADC_CH_ACCUMULATE | + u32 ctrl4_set = 0; + u32 ctrl4_clr = 0; + u32 ctrl1_irq = 0; + const u32 chan_value = LRADC_CH_ACCUMULATE | ((LRADC_DELAY_TIMER_LOOP - 1) << LRADC_CH_NUM_SAMPLES_OFFSET); const int len = bitmap_weight(iio->active_scan_mask, LRADC_MAX_TOTAL_CHANS); @@ -1456,7 +1456,7 @@ static const struct iio_chan_spec mx28_lradc_chan_spec[] = { static int mxs_lradc_hw_init(struct mxs_lradc *lradc) { /* The ADC always uses DELAY CHANNEL 0. */ - const uint32_t adc_cfg = + const u32 adc_cfg = (1 << (LRADC_DELAY_TRIGGER_DELAYS_OFFSET + 0)) | (LRADC_DELAY_TIMER_PER << LRADC_DELAY_DELAY_OFFSET); @@ -1583,7 +1583,7 @@ static int mxs_lradc_probe(struct platform_device *pdev) struct resource *iores; int ret = 0, touch_ret; int i, s; - uint64_t scale_uv; + u64 scale_uv; /* Allocate the IIO device. */ iio = devm_iio_device_alloc(dev, sizeof(*lradc)); -- 2.1.4 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 2/9] staging: iio: adc: properly indent to match open paranthesis 2015-10-07 18:13 [PATCH v2 0/9] staging: iio: adc: fix multiple checkpatch issues Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 1/9] staging: iio: adc: use kernel types u32 and u64 Ioana Ciornei @ 2015-10-07 18:13 ` Ioana Ciornei 2015-10-08 4:55 ` [Outreachy kernel] " Sudip Mukherjee 2015-10-07 18:13 ` [PATCH v2 3/9] staging: iio: adc: remove explicit comparison to NULL Ioana Ciornei ` (6 subsequent siblings) 8 siblings, 1 reply; 17+ messages in thread From: Ioana Ciornei @ 2015-10-07 18:13 UTC (permalink / raw) To: outreachy-kernel; +Cc: Ioana Ciornei Indent parameters ansd arguments passed to function calls to match open paranthesis Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> --- Changes in v2: - nothing drivers/staging/iio/adc/ad7192.c | 44 +++++----- drivers/staging/iio/adc/ad7280a.c | 153 +++++++++++++++++----------------- drivers/staging/iio/adc/ad7606_core.c | 19 +++-- drivers/staging/iio/adc/ad7606_par.c | 10 +-- drivers/staging/iio/adc/ad7606_spi.c | 4 +- drivers/staging/iio/adc/ad7780.c | 8 +- drivers/staging/iio/adc/ad7816.c | 48 +++++------ drivers/staging/iio/adc/lpc32xx_adc.c | 14 ++-- drivers/staging/iio/adc/mxs-lradc.c | 136 +++++++++++++++--------------- drivers/staging/iio/adc/spear_adc.c | 4 +- 10 files changed, 220 insertions(+), 220 deletions(-) diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index fe56fb6..21d83c5 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c @@ -201,7 +201,7 @@ static int ad7192_calibrate_all(struct ad7192_state *st) } static int ad7192_setup(struct ad7192_state *st, - const struct ad7192_platform_data *pdata) + const struct ad7192_platform_data *pdata) { struct iio_dev *indio_dev = spi_get_drvdata(st->sd.spi); unsigned long long scale_uv; @@ -224,7 +224,7 @@ static int ad7192_setup(struct ad7192_state *st, if (id != st->devid) dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X)\n", - id); + id); switch (pdata->clock_source_sel) { case AD7192_CLK_EXT_MCLK1_2: @@ -307,8 +307,8 @@ out: } static ssize_t ad7192_read_frequency(struct device *dev, - struct device_attribute *attr, - char *buf) + struct device_attribute *attr, + char *buf) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7192_state *st = iio_priv(indio_dev); @@ -318,9 +318,9 @@ static ssize_t ad7192_read_frequency(struct device *dev, } static ssize_t ad7192_write_frequency(struct device *dev, - struct device_attribute *attr, - const char *buf, - size_t len) + struct device_attribute *attr, + const char *buf, + size_t len) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7192_state *st = iio_priv(indio_dev); @@ -360,7 +360,7 @@ static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO, ad7192_write_frequency); static ssize_t ad7192_show_scale_available(struct device *dev, - struct device_attribute *attr, char *buf) + struct device_attribute *attr, char *buf) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7192_state *st = iio_priv(indio_dev); @@ -383,8 +383,8 @@ static IIO_DEVICE_ATTR(in_voltage_scale_available, S_IRUGO, ad7192_show_scale_available, NULL, 0); static ssize_t ad7192_show_ac_excitation(struct device *dev, - struct device_attribute *attr, - char *buf) + struct device_attribute *attr, + char *buf) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7192_state *st = iio_priv(indio_dev); @@ -393,8 +393,8 @@ static ssize_t ad7192_show_ac_excitation(struct device *dev, } static ssize_t ad7192_show_bridge_switch(struct device *dev, - struct device_attribute *attr, - char *buf) + struct device_attribute *attr, + char *buf) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7192_state *st = iio_priv(indio_dev); @@ -403,9 +403,9 @@ static ssize_t ad7192_show_bridge_switch(struct device *dev, } static ssize_t ad7192_set(struct device *dev, - struct device_attribute *attr, - const char *buf, - size_t len) + struct device_attribute *attr, + const char *buf, + size_t len) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7192_state *st = iio_priv(indio_dev); @@ -529,10 +529,10 @@ static int ad7192_read_raw(struct iio_dev *indio_dev, } static int ad7192_write_raw(struct iio_dev *indio_dev, - struct iio_chan_spec const *chan, - int val, - int val2, - long mask) + struct iio_chan_spec const *chan, + int val, + int val2, + long mask) { struct ad7192_state *st = iio_priv(indio_dev); int ret, i; @@ -556,7 +556,7 @@ static int ad7192_write_raw(struct iio_dev *indio_dev, if (tmp == st->conf) break; ad_sd_write_reg(&st->sd, AD7192_REG_CONF, - 3, st->conf); + 3, st->conf); ad7192_calibrate_all(st); break; } @@ -571,8 +571,8 @@ static int ad7192_write_raw(struct iio_dev *indio_dev, } static int ad7192_write_raw_get_fmt(struct iio_dev *indio_dev, - struct iio_chan_spec const *chan, - long mask) + struct iio_chan_spec const *chan, + long mask) { return IIO_VAL_INT_PLUS_NANO; } diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index d98e229..26c9c12 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -224,24 +224,24 @@ static int ad7280_write(struct ad7280_state *st, unsigned devaddr, } static int ad7280_read(struct ad7280_state *st, unsigned devaddr, - unsigned addr) + unsigned addr) { int ret; unsigned tmp; /* turns off the read operation on all parts */ ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, AD7280A_CONTROL_HB, 1, - AD7280A_CTRL_HB_CONV_INPUT_ALL | - AD7280A_CTRL_HB_CONV_RES_READ_NO | - st->ctrl_hb); + AD7280A_CTRL_HB_CONV_INPUT_ALL | + AD7280A_CTRL_HB_CONV_RES_READ_NO | + st->ctrl_hb); if (ret) return ret; /* turns on the read operation on the addressed part */ ret = ad7280_write(st, devaddr, AD7280A_CONTROL_HB, 0, - AD7280A_CTRL_HB_CONV_INPUT_ALL | - AD7280A_CTRL_HB_CONV_RES_READ_ALL | - st->ctrl_hb); + AD7280A_CTRL_HB_CONV_INPUT_ALL | + AD7280A_CTRL_HB_CONV_RES_READ_ALL | + st->ctrl_hb); if (ret) return ret; @@ -272,17 +272,17 @@ static int ad7280_read_channel(struct ad7280_state *st, unsigned devaddr, return ret; ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, AD7280A_CONTROL_HB, 1, - AD7280A_CTRL_HB_CONV_INPUT_ALL | - AD7280A_CTRL_HB_CONV_RES_READ_NO | - st->ctrl_hb); + AD7280A_CTRL_HB_CONV_INPUT_ALL | + AD7280A_CTRL_HB_CONV_RES_READ_NO | + st->ctrl_hb); if (ret) return ret; ret = ad7280_write(st, devaddr, AD7280A_CONTROL_HB, 0, - AD7280A_CTRL_HB_CONV_INPUT_ALL | - AD7280A_CTRL_HB_CONV_RES_READ_ALL | - AD7280A_CTRL_HB_CONV_START_CS | - st->ctrl_hb); + AD7280A_CTRL_HB_CONV_INPUT_ALL | + AD7280A_CTRL_HB_CONV_RES_READ_ALL | + AD7280A_CTRL_HB_CONV_START_CS | + st->ctrl_hb); if (ret) return ret; @@ -300,7 +300,7 @@ static int ad7280_read_channel(struct ad7280_state *st, unsigned devaddr, } static int ad7280_read_all_channels(struct ad7280_state *st, unsigned cnt, - unsigned *array) + unsigned *array) { int i, ret; unsigned tmp, sum = 0; @@ -311,10 +311,10 @@ static int ad7280_read_all_channels(struct ad7280_state *st, unsigned cnt, return ret; ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, AD7280A_CONTROL_HB, 1, - AD7280A_CTRL_HB_CONV_INPUT_ALL | - AD7280A_CTRL_HB_CONV_RES_READ_ALL | - AD7280A_CTRL_HB_CONV_START_CS | - st->ctrl_hb); + AD7280A_CTRL_HB_CONV_INPUT_ALL | + AD7280A_CTRL_HB_CONV_RES_READ_ALL | + AD7280A_CTRL_HB_CONV_START_CS | + st->ctrl_hb); if (ret) return ret; @@ -342,24 +342,24 @@ static int ad7280_chain_setup(struct ad7280_state *st) int ret; ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, AD7280A_CONTROL_LB, 1, - AD7280A_CTRL_LB_DAISY_CHAIN_RB_EN | - AD7280A_CTRL_LB_LOCK_DEV_ADDR | - AD7280A_CTRL_LB_MUST_SET | - AD7280A_CTRL_LB_SWRST | - st->ctrl_lb); + AD7280A_CTRL_LB_DAISY_CHAIN_RB_EN | + AD7280A_CTRL_LB_LOCK_DEV_ADDR | + AD7280A_CTRL_LB_MUST_SET | + AD7280A_CTRL_LB_SWRST | + st->ctrl_lb); if (ret) return ret; ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, AD7280A_CONTROL_LB, 1, - AD7280A_CTRL_LB_DAISY_CHAIN_RB_EN | - AD7280A_CTRL_LB_LOCK_DEV_ADDR | - AD7280A_CTRL_LB_MUST_SET | - st->ctrl_lb); + AD7280A_CTRL_LB_DAISY_CHAIN_RB_EN | + AD7280A_CTRL_LB_LOCK_DEV_ADDR | + AD7280A_CTRL_LB_MUST_SET | + st->ctrl_lb); if (ret) return ret; ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, AD7280A_READ, 1, - AD7280A_CONTROL_LB << 2); + AD7280A_CONTROL_LB << 2); if (ret) return ret; @@ -379,8 +379,8 @@ static int ad7280_chain_setup(struct ad7280_state *st) } static ssize_t ad7280_show_balance_sw(struct device *dev, - struct device_attribute *attr, - char *buf) + struct device_attribute *attr, + char *buf) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7280_state *st = iio_priv(indio_dev); @@ -392,9 +392,9 @@ static ssize_t ad7280_show_balance_sw(struct device *dev, } static ssize_t ad7280_store_balance_sw(struct device *dev, - struct device_attribute *attr, - const char *buf, - size_t len) + struct device_attribute *attr, + const char *buf, + size_t len) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7280_state *st = iio_priv(indio_dev); @@ -424,8 +424,8 @@ static ssize_t ad7280_store_balance_sw(struct device *dev, } static ssize_t ad7280_show_balance_timer(struct device *dev, - struct device_attribute *attr, - char *buf) + struct device_attribute *attr, + char *buf) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7280_state *st = iio_priv(indio_dev); @@ -435,7 +435,7 @@ static ssize_t ad7280_show_balance_timer(struct device *dev, mutex_lock(&indio_dev->mlock); ret = ad7280_read(st, this_attr->address >> 8, - this_attr->address & 0xFF); + this_attr->address & 0xFF); mutex_unlock(&indio_dev->mlock); if (ret < 0) @@ -447,9 +447,9 @@ static ssize_t ad7280_show_balance_timer(struct device *dev, } static ssize_t ad7280_store_balance_timer(struct device *dev, - struct device_attribute *attr, - const char *buf, - size_t len) + struct device_attribute *attr, + const char *buf, + size_t len) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7280_state *st = iio_priv(indio_dev); @@ -492,8 +492,7 @@ static int ad7280_channel_init(struct ad7280_state *st) return -ENOMEM; for (dev = 0, cnt = 0; dev <= st->slave_num; dev++) - for (ch = AD7280A_CELL_VOLTAGE_1; ch <= AD7280A_AUX_ADC_6; ch++, - cnt++) { + for (ch = AD7280A_CELL_VOLTAGE_1; ch <= AD7280A_AUX_ADC_6; ch++, cnt++) { if (ch < AD7280A_AUX_ADC_1) { st->channels[cnt].type = IIO_VOLTAGE; st->channels[cnt].differential = 1; @@ -566,9 +565,9 @@ static int ad7280_attr_init(struct ad7280_state *st) ad7280_store_balance_sw; st->iio_attr[cnt].dev_attr.attr.name = kasprintf(GFP_KERNEL, - "in%d-in%d_balance_switch_en", - (dev * AD7280A_CELLS_PER_DEV) + ch, - (dev * AD7280A_CELLS_PER_DEV) + ch + 1); + "in%d-in%d_balance_switch_en", + (dev * AD7280A_CELLS_PER_DEV) + ch, + (dev * AD7280A_CELLS_PER_DEV) + ch + 1); ad7280_attributes[cnt] = &st->iio_attr[cnt].dev_attr.attr; cnt++; @@ -583,8 +582,8 @@ static int ad7280_attr_init(struct ad7280_state *st) ad7280_store_balance_timer; st->iio_attr[cnt].dev_attr.attr.name = kasprintf(GFP_KERNEL, "in%d-in%d_balance_timer", - (dev * AD7280A_CELLS_PER_DEV) + ch, - (dev * AD7280A_CELLS_PER_DEV) + ch + 1); + (dev * AD7280A_CELLS_PER_DEV) + ch, + (dev * AD7280A_CELLS_PER_DEV) + ch + 1); ad7280_attributes[cnt] = &st->iio_attr[cnt].dev_attr.attr; } @@ -595,8 +594,8 @@ static int ad7280_attr_init(struct ad7280_state *st) } static ssize_t ad7280_read_channel_config(struct device *dev, - struct device_attribute *attr, - char *buf) + struct device_attribute *attr, + char *buf) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7280_state *st = iio_priv(indio_dev); @@ -624,9 +623,9 @@ static ssize_t ad7280_read_channel_config(struct device *dev, } static ssize_t ad7280_write_channel_config(struct device *dev, - struct device_attribute *attr, - const char *buf, - size_t len) + struct device_attribute *attr, + const char *buf, + size_t len) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7280_state *st = iio_priv(indio_dev); @@ -698,39 +697,39 @@ static irqreturn_t ad7280_event_handler(int irq, void *private) if (((channels[i] >> 11) & 0xFFF) >= st->cell_threshhigh) iio_push_event(indio_dev, - IIO_EVENT_CODE(IIO_VOLTAGE, - 1, - 0, - IIO_EV_DIR_RISING, - IIO_EV_TYPE_THRESH, - 0, 0, 0), - iio_get_time_ns()); + IIO_EVENT_CODE(IIO_VOLTAGE, + 1, + 0, + IIO_EV_DIR_RISING, + IIO_EV_TYPE_THRESH, + 0, 0, 0), + iio_get_time_ns()); else if (((channels[i] >> 11) & 0xFFF) <= st->cell_threshlow) iio_push_event(indio_dev, - IIO_EVENT_CODE(IIO_VOLTAGE, - 1, - 0, - IIO_EV_DIR_FALLING, - IIO_EV_TYPE_THRESH, - 0, 0, 0), - iio_get_time_ns()); + IIO_EVENT_CODE(IIO_VOLTAGE, + 1, + 0, + IIO_EV_DIR_FALLING, + IIO_EV_TYPE_THRESH, + 0, 0, 0), + iio_get_time_ns()); } else { if (((channels[i] >> 11) & 0xFFF) >= st->aux_threshhigh) iio_push_event(indio_dev, - IIO_UNMOD_EVENT_CODE(IIO_TEMP, - 0, - IIO_EV_TYPE_THRESH, - IIO_EV_DIR_RISING), - iio_get_time_ns()); + IIO_UNMOD_EVENT_CODE(IIO_TEMP, + 0, + IIO_EV_TYPE_THRESH, + IIO_EV_DIR_RISING), + iio_get_time_ns()); else if (((channels[i] >> 11) & 0xFFF) <= st->aux_threshlow) iio_push_event(indio_dev, - IIO_UNMOD_EVENT_CODE(IIO_TEMP, - 0, - IIO_EV_TYPE_THRESH, - IIO_EV_DIR_FALLING), - iio_get_time_ns()); + IIO_UNMOD_EVENT_CODE(IIO_TEMP, + 0, + IIO_EV_TYPE_THRESH, + IIO_EV_DIR_FALLING), + iio_get_time_ns()); } } @@ -955,7 +954,7 @@ static int ad7280_remove(struct spi_device *spi) iio_device_unregister(indio_dev); ad7280_write(st, AD7280A_DEVADDR_MASTER, AD7280A_CONTROL_HB, 1, - AD7280A_CTRL_HB_PWRDN_SW | st->ctrl_hb); + AD7280A_CTRL_HB_PWRDN_SW | st->ctrl_hb); kfree(st->channels); kfree(st->iio_attr); diff --git a/drivers/staging/iio/adc/ad7606_core.c b/drivers/staging/iio/adc/ad7606_core.c index bf2c801..6dc7413 100644 --- a/drivers/staging/iio/adc/ad7606_core.c +++ b/drivers/staging/iio/adc/ad7606_core.c @@ -108,7 +108,7 @@ static int ad7606_read_raw(struct iio_dev *indio_dev, } static ssize_t ad7606_show_range(struct device *dev, - struct device_attribute *attr, char *buf) + struct device_attribute *attr, char *buf) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7606_state *st = iio_priv(indio_dev); @@ -117,7 +117,7 @@ static ssize_t ad7606_show_range(struct device *dev, } static ssize_t ad7606_store_range(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) + struct device_attribute *attr, const char *buf, size_t count) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7606_state *st = iio_priv(indio_dev); @@ -145,7 +145,7 @@ static IIO_DEVICE_ATTR(in_voltage_range, S_IRUGO | S_IWUSR, static IIO_CONST_ATTR(in_voltage_range_available, "5000 10000"); static ssize_t ad7606_show_oversampling_ratio(struct device *dev, - struct device_attribute *attr, char *buf) + struct device_attribute *attr, char *buf) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7606_state *st = iio_priv(indio_dev); @@ -166,7 +166,8 @@ static int ad7606_oversampling_get_index(unsigned val) } static ssize_t ad7606_store_oversampling_ratio(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) + struct device_attribute *attr, + const char *buf, size_t count) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7606_state *st = iio_priv(indio_dev); @@ -460,9 +461,9 @@ static const struct iio_info ad7606_info_range = { }; struct iio_dev *ad7606_probe(struct device *dev, int irq, - void __iomem *base_address, - unsigned id, - const struct ad7606_bus_ops *bops) + void __iomem *base_address, + unsigned id, + const struct ad7606_bus_ops *bops) { struct ad7606_platform_data *pdata = dev->platform_data; struct ad7606_state *st; @@ -529,7 +530,7 @@ struct iio_dev *ad7606_probe(struct device *dev, int irq, dev_warn(st->dev, "failed to RESET: no RESET GPIO specified\n"); ret = request_irq(irq, ad7606_interrupt, - IRQF_TRIGGER_FALLING, st->chip_info->name, indio_dev); + IRQF_TRIGGER_FALLING, st->chip_info->name, indio_dev); if (ret) goto error_free_gpios; @@ -591,7 +592,7 @@ void ad7606_resume(struct iio_dev *indio_dev) if (gpio_is_valid(st->pdata->gpio_stby)) { if (gpio_is_valid(st->pdata->gpio_range)) gpio_set_value(st->pdata->gpio_range, - st->range == 10000); + st->range == 10000); gpio_set_value(st->pdata->gpio_stby, 1); ad7606_reset(st); diff --git a/drivers/staging/iio/adc/ad7606_par.c b/drivers/staging/iio/adc/ad7606_par.c index 1d48ae3..fbe8237 100644 --- a/drivers/staging/iio/adc/ad7606_par.c +++ b/drivers/staging/iio/adc/ad7606_par.c @@ -16,7 +16,7 @@ #include "ad7606.h" static int ad7606_par16_read_block(struct device *dev, - int count, void *buf) + int count, void *buf) { struct platform_device *pdev = to_platform_device(dev); struct iio_dev *indio_dev = platform_get_drvdata(pdev); @@ -32,7 +32,7 @@ static const struct ad7606_bus_ops ad7606_par16_bops = { }; static int ad7606_par8_read_block(struct device *dev, - int count, void *buf) + int count, void *buf) { struct platform_device *pdev = to_platform_device(dev); struct iio_dev *indio_dev = platform_get_drvdata(pdev); @@ -69,9 +69,9 @@ static int ad7606_par_probe(struct platform_device *pdev) remap_size = resource_size(res); indio_dev = ad7606_probe(&pdev->dev, irq, addr, - platform_get_device_id(pdev)->driver_data, - remap_size > 1 ? &ad7606_par16_bops : - &ad7606_par8_bops); + platform_get_device_id(pdev)->driver_data, + remap_size > 1 ? &ad7606_par16_bops : + &ad7606_par8_bops); if (IS_ERR(indio_dev)) return PTR_ERR(indio_dev); diff --git a/drivers/staging/iio/adc/ad7606_spi.c b/drivers/staging/iio/adc/ad7606_spi.c index 7303983..9c62e94 100644 --- a/drivers/staging/iio/adc/ad7606_spi.c +++ b/drivers/staging/iio/adc/ad7606_spi.c @@ -44,8 +44,8 @@ static int ad7606_spi_probe(struct spi_device *spi) struct iio_dev *indio_dev; indio_dev = ad7606_probe(&spi->dev, spi->irq, NULL, - spi_get_device_id(spi)->driver_data, - &ad7606_spi_bops); + spi_get_device_id(spi)->driver_data, + &ad7606_spi_bops); if (IS_ERR(indio_dev)) return PTR_ERR(indio_dev); diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c index 9f03fe3..501dc9f 100644 --- a/drivers/staging/iio/adc/ad7780.c +++ b/drivers/staging/iio/adc/ad7780.c @@ -62,7 +62,7 @@ static struct ad7780_state *ad_sigma_delta_to_ad7780(struct ad_sigma_delta *sd) } static int ad7780_set_mode(struct ad_sigma_delta *sigma_delta, - enum ad_sigma_delta_mode mode) + enum ad_sigma_delta_mode mode) { struct ad7780_state *st = ad_sigma_delta_to_ad7780(sigma_delta); unsigned val; @@ -107,13 +107,13 @@ static int ad7780_read_raw(struct iio_dev *indio_dev, } static int ad7780_postprocess_sample(struct ad_sigma_delta *sigma_delta, - unsigned int raw_sample) + unsigned int raw_sample) { struct ad7780_state *st = ad_sigma_delta_to_ad7780(sigma_delta); const struct ad7780_chip_info *chip_info = st->chip_info; if ((raw_sample & AD7780_ERR) || - ((raw_sample & chip_info->pattern_mask) != chip_info->pattern)) + ((raw_sample & chip_info->pattern_mask) != chip_info->pattern)) return -EIO; if (raw_sample & AD7780_GAIN) @@ -208,7 +208,7 @@ static int ad7780_probe(struct spi_device *spi) if (pdata && gpio_is_valid(pdata->gpio_pdrst)) { ret = devm_gpio_request_one(&spi->dev, pdata->gpio_pdrst, - GPIOF_OUT_INIT_LOW, "AD7780 /PDRST"); + GPIOF_OUT_INIT_LOW, "AD7780 /PDRST"); if (ret) { dev_err(&spi->dev, "failed to request GPIO PDRST\n"); goto error_disable_reg; diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c index 48b1c37..4e954d2 100644 --- a/drivers/staging/iio/adc/ad7816.c +++ b/drivers/staging/iio/adc/ad7816.c @@ -110,8 +110,8 @@ static int ad7816_spi_write(struct ad7816_chip_info *chip, u8 data) } static ssize_t ad7816_show_mode(struct device *dev, - struct device_attribute *attr, - char *buf) + struct device_attribute *attr, + char *buf) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7816_chip_info *chip = iio_priv(indio_dev); @@ -122,9 +122,9 @@ static ssize_t ad7816_show_mode(struct device *dev, } static ssize_t ad7816_store_mode(struct device *dev, - struct device_attribute *attr, - const char *buf, - size_t len) + struct device_attribute *attr, + const char *buf, + size_t len) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7816_chip_info *chip = iio_priv(indio_dev); @@ -146,8 +146,8 @@ static IIO_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, 0); static ssize_t ad7816_show_available_modes(struct device *dev, - struct device_attribute *attr, - char *buf) + struct device_attribute *attr, + char *buf) { return sprintf(buf, "full\npower-save\n"); } @@ -156,8 +156,8 @@ static IIO_DEVICE_ATTR(available_modes, S_IRUGO, ad7816_show_available_modes, NULL, 0); static ssize_t ad7816_show_channel(struct device *dev, - struct device_attribute *attr, - char *buf) + struct device_attribute *attr, + char *buf) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7816_chip_info *chip = iio_priv(indio_dev); @@ -166,9 +166,9 @@ static ssize_t ad7816_show_channel(struct device *dev, } static ssize_t ad7816_store_channel(struct device *dev, - struct device_attribute *attr, - const char *buf, - size_t len) + struct device_attribute *attr, + const char *buf, + size_t len) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7816_chip_info *chip = iio_priv(indio_dev); @@ -205,8 +205,8 @@ static IIO_DEVICE_ATTR(channel, S_IRUGO | S_IWUSR, static ssize_t ad7816_show_value(struct device *dev, - struct device_attribute *attr, - char *buf) + struct device_attribute *attr, + char *buf) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7816_chip_info *chip = iio_priv(indio_dev); @@ -260,8 +260,8 @@ static irqreturn_t ad7816_event_handler(int irq, void *private) } static ssize_t ad7816_show_oti(struct device *dev, - struct device_attribute *attr, - char *buf) + struct device_attribute *attr, + char *buf) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7816_chip_info *chip = iio_priv(indio_dev); @@ -280,9 +280,9 @@ static ssize_t ad7816_show_oti(struct device *dev, } static inline ssize_t ad7816_set_oti(struct device *dev, - struct device_attribute *attr, - const char *buf, - size_t len) + struct device_attribute *attr, + const char *buf, + size_t len) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7816_chip_info *chip = iio_priv(indio_dev); @@ -299,7 +299,7 @@ static inline ssize_t ad7816_set_oti(struct device *dev, return -EINVAL; } else if (chip->channel_id == 0) { if (ret || value < AD7816_BOUND_VALUE_MIN || - value > AD7816_BOUND_VALUE_MAX) + value > AD7816_BOUND_VALUE_MAX) return -EINVAL; data = (u8)(value - AD7816_BOUND_VALUE_MIN + @@ -371,7 +371,7 @@ static int ad7816_probe(struct spi_device *spi_dev) chip->busy_pin = pins[2]; ret = devm_gpio_request(&spi_dev->dev, chip->rdwr_pin, - spi_get_device_id(spi_dev)->name); + spi_get_device_id(spi_dev)->name); if (ret) { dev_err(&spi_dev->dev, "Fail to request rdwr gpio PIN %d.\n", chip->rdwr_pin); @@ -379,7 +379,7 @@ static int ad7816_probe(struct spi_device *spi_dev) } gpio_direction_input(chip->rdwr_pin); ret = devm_gpio_request(&spi_dev->dev, chip->convert_pin, - spi_get_device_id(spi_dev)->name); + spi_get_device_id(spi_dev)->name); if (ret) { dev_err(&spi_dev->dev, "Fail to request convert gpio PIN %d.\n", chip->convert_pin); @@ -387,7 +387,7 @@ static int ad7816_probe(struct spi_device *spi_dev) } gpio_direction_input(chip->convert_pin); ret = devm_gpio_request(&spi_dev->dev, chip->busy_pin, - spi_get_device_id(spi_dev)->name); + spi_get_device_id(spi_dev)->name); if (ret) { dev_err(&spi_dev->dev, "Fail to request busy gpio PIN %d.\n", chip->busy_pin); @@ -417,7 +417,7 @@ static int ad7816_probe(struct spi_device *spi_dev) return ret; dev_info(&spi_dev->dev, "%s temperature sensor and ADC registered.\n", - indio_dev->name); + indio_dev->name); return 0; } diff --git a/drivers/staging/iio/adc/lpc32xx_adc.c b/drivers/staging/iio/adc/lpc32xx_adc.c index bcf4ebb..d11c54b 100644 --- a/drivers/staging/iio/adc/lpc32xx_adc.c +++ b/drivers/staging/iio/adc/lpc32xx_adc.c @@ -67,10 +67,10 @@ struct lpc32xx_adc_info { }; static int lpc32xx_read_raw(struct iio_dev *indio_dev, - struct iio_chan_spec const *chan, - int *val, - int *val2, - long mask) + struct iio_chan_spec const *chan, + int *val, + int *val2, + long mask) { struct lpc32xx_adc_info *info = iio_priv(indio_dev); @@ -79,10 +79,10 @@ static int lpc32xx_read_raw(struct iio_dev *indio_dev, clk_enable(info->clk); /* Measurement setup */ __raw_writel(AD_INTERNAL | (chan->address) | AD_REFp | AD_REFm, - LPC32XX_ADC_SELECT(info->adc_base)); + LPC32XX_ADC_SELECT(info->adc_base)); /* Trigger conversion */ __raw_writel(AD_PDN_CTRL | AD_STROBE, - LPC32XX_ADC_CTRL(info->adc_base)); + LPC32XX_ADC_CTRL(info->adc_base)); wait_for_completion(&info->completion); /* set by ISR */ clk_disable(info->clk); *val = info->value; @@ -166,7 +166,7 @@ static int lpc32xx_adc_probe(struct platform_device *pdev) } retval = devm_request_irq(&pdev->dev, irq, lpc32xx_adc_isr, 0, - MOD_NAME, info); + MOD_NAME, info); if (retval < 0) { dev_err(&pdev->dev, "failed requesting interrupt\n"); return retval; diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c index d88d85b..208f928 100644 --- a/drivers/staging/iio/adc/mxs-lradc.c +++ b/drivers/staging/iio/adc/mxs-lradc.c @@ -425,7 +425,7 @@ static void mxs_lradc_map_channel(struct mxs_lradc *lradc, unsigned vch, unsigned ch) { mxs_lradc_reg_clear(lradc, LRADC_CTRL4_LRADCSELECT_MASK(vch), - LRADC_CTRL4); + LRADC_CTRL4); mxs_lradc_reg_set(lradc, LRADC_CTRL4_LRADCSELECT(vch, ch), LRADC_CTRL4); } @@ -440,8 +440,8 @@ static void mxs_lradc_setup_ts_channel(struct mxs_lradc *lradc, unsigned ch) * otherwise, the IRQs will not fire." */ mxs_lradc_reg_wrt(lradc, LRADC_CH_ACCUMULATE | - LRADC_CH_NUM_SAMPLES(lradc->over_sample_cnt - 1), - LRADC_CH(ch)); + LRADC_CH_NUM_SAMPLES(lradc->over_sample_cnt - 1), + LRADC_CH(ch)); /* from the datasheet: * "Software must clear this register in preparation for a @@ -458,10 +458,10 @@ static void mxs_lradc_setup_ts_channel(struct mxs_lradc *lradc, unsigned ch) * the LRADC will not trigger the delay group." */ mxs_lradc_reg_wrt(lradc, LRADC_DELAY_TRIGGER(1 << ch) | - LRADC_DELAY_TRIGGER_DELAYS(0) | - LRADC_DELAY_LOOP(lradc->over_sample_cnt - 1) | - LRADC_DELAY_DELAY(lradc->over_sample_delay - 1), - LRADC_DELAY(3)); + LRADC_DELAY_TRIGGER_DELAYS(0) | + LRADC_DELAY_LOOP(lradc->over_sample_cnt - 1) | + LRADC_DELAY_DELAY(lradc->over_sample_delay - 1), + LRADC_DELAY(3)); mxs_lradc_reg_clear(lradc, LRADC_CTRL1_LRADC_IRQ(ch), LRADC_CTRL1); @@ -472,11 +472,11 @@ static void mxs_lradc_setup_ts_channel(struct mxs_lradc *lradc, unsigned ch) * and automatically. */ mxs_lradc_reg_wrt(lradc, - LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC */ - LRADC_DELAY_TRIGGER_DELAYS(BIT(3)) | /* trigger DELAY unit#3 */ - LRADC_DELAY_KICK | - LRADC_DELAY_DELAY(lradc->settling_delay), - LRADC_DELAY(2)); + LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC */ + LRADC_DELAY_TRIGGER_DELAYS(BIT(3)) | /* trigger DELAY unit#3 */ + LRADC_DELAY_KICK | + LRADC_DELAY_DELAY(lradc->settling_delay), + LRADC_DELAY(2)); } /* @@ -486,7 +486,7 @@ static void mxs_lradc_setup_ts_channel(struct mxs_lradc *lradc, unsigned ch) * hardware report one interrupt if both conversions are done */ static void mxs_lradc_setup_ts_pressure(struct mxs_lradc *lradc, unsigned ch1, - unsigned ch2) + unsigned ch2) { u32 reg; @@ -512,11 +512,11 @@ static void mxs_lradc_setup_ts_pressure(struct mxs_lradc *lradc, unsigned ch1, /* prepare the delay/loop unit according to the oversampling count */ mxs_lradc_reg_wrt(lradc, LRADC_DELAY_TRIGGER(1 << ch1) | - LRADC_DELAY_TRIGGER(1 << ch2) | /* start both channels */ - LRADC_DELAY_TRIGGER_DELAYS(0) | - LRADC_DELAY_LOOP(lradc->over_sample_cnt - 1) | - LRADC_DELAY_DELAY(lradc->over_sample_delay - 1), - LRADC_DELAY(3)); + LRADC_DELAY_TRIGGER(1 << ch2) | /* start both channels */ + LRADC_DELAY_TRIGGER_DELAYS(0) | + LRADC_DELAY_LOOP(lradc->over_sample_cnt - 1) | + LRADC_DELAY_DELAY(lradc->over_sample_delay - 1), + LRADC_DELAY(3)); mxs_lradc_reg_clear(lradc, LRADC_CTRL1_LRADC_IRQ(ch2), LRADC_CTRL1); @@ -527,14 +527,14 @@ static void mxs_lradc_setup_ts_pressure(struct mxs_lradc *lradc, unsigned ch1, * and automatically. */ mxs_lradc_reg_wrt(lradc, - LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC */ - LRADC_DELAY_TRIGGER_DELAYS(BIT(3)) | /* trigger DELAY unit#3 */ - LRADC_DELAY_KICK | - LRADC_DELAY_DELAY(lradc->settling_delay), LRADC_DELAY(2)); + LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC */ + LRADC_DELAY_TRIGGER_DELAYS(BIT(3)) | /* trigger DELAY unit#3 */ + LRADC_DELAY_KICK | + LRADC_DELAY_DELAY(lradc->settling_delay), LRADC_DELAY(2)); } static unsigned mxs_lradc_read_raw_channel(struct mxs_lradc *lradc, - unsigned channel) + unsigned channel) { u32 reg; unsigned num_samples, val; @@ -550,7 +550,7 @@ static unsigned mxs_lradc_read_raw_channel(struct mxs_lradc *lradc, } static unsigned mxs_lradc_read_ts_pressure(struct mxs_lradc *lradc, - unsigned ch1, unsigned ch2) + unsigned ch1, unsigned ch2) { u32 reg, mask; unsigned pressure, m1, m2; @@ -607,7 +607,7 @@ static void mxs_lradc_setup_touch_detection(struct mxs_lradc *lradc) */ mxs_lradc_reg_clear(lradc, mxs_lradc_plate_mask(lradc), LRADC_CTRL0); mxs_lradc_reg_set(lradc, mxs_lradc_touch_detect_bit(lradc), - LRADC_CTRL0); + LRADC_CTRL0); } /* @@ -675,7 +675,7 @@ static void mxs_lradc_prepare_pressure(struct mxs_lradc *lradc) mxs_lradc_map_channel(lradc, TOUCHSCREEN_VCHANNEL1, TS_CH_YM); mxs_lradc_map_channel(lradc, TOUCHSCREEN_VCHANNEL2, TS_CH_XP); mxs_lradc_setup_ts_pressure(lradc, TOUCHSCREEN_VCHANNEL2, - TOUCHSCREEN_VCHANNEL1); + TOUCHSCREEN_VCHANNEL1); } static void mxs_lradc_enable_touch_detection(struct mxs_lradc *lradc) @@ -684,16 +684,16 @@ static void mxs_lradc_enable_touch_detection(struct mxs_lradc *lradc) lradc->cur_plate = LRADC_TOUCH; mxs_lradc_reg_clear(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ | - LRADC_CTRL1_TOUCH_DETECT_IRQ_EN, LRADC_CTRL1); + LRADC_CTRL1_TOUCH_DETECT_IRQ_EN, LRADC_CTRL1); mxs_lradc_reg_set(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ_EN, LRADC_CTRL1); } static void mxs_lradc_start_touch_event(struct mxs_lradc *lradc) { mxs_lradc_reg_clear(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ_EN, - LRADC_CTRL1); + LRADC_CTRL1); mxs_lradc_reg_set(lradc, - LRADC_CTRL1_LRADC_IRQ_EN(TOUCHSCREEN_VCHANNEL1), LRADC_CTRL1); + LRADC_CTRL1_LRADC_IRQ_EN(TOUCHSCREEN_VCHANNEL1), LRADC_CTRL1); /* * start with the Y-pos, because it uses nearly the same plate * settings like the touch detection @@ -720,12 +720,12 @@ static void mxs_lradc_complete_touch_event(struct mxs_lradc *lradc) */ mxs_lradc_reg_wrt(lradc, 0, LRADC_CH(TOUCHSCREEN_VCHANNEL1)); mxs_lradc_reg_clear(lradc, - LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL1) | - LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL2), LRADC_CTRL1); + LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL1) | + LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL2), LRADC_CTRL1); mxs_lradc_reg_wrt(lradc, - LRADC_DELAY_TRIGGER(1 << TOUCHSCREEN_VCHANNEL1) | - LRADC_DELAY_KICK | LRADC_DELAY_DELAY(10), /* waste 5 ms */ - LRADC_DELAY(2)); + LRADC_DELAY_TRIGGER(1 << TOUCHSCREEN_VCHANNEL1) | + LRADC_DELAY_KICK | LRADC_DELAY_DELAY(10), /* waste 5 ms */ + LRADC_DELAY(2)); } /* @@ -758,8 +758,8 @@ static void mxs_lradc_finish_touch_event(struct mxs_lradc *lradc, bool valid) mxs_lradc_reg_wrt(lradc, 0, LRADC_DELAY(2)); mxs_lradc_reg_wrt(lradc, 0, LRADC_DELAY(3)); mxs_lradc_reg_clear(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ | - LRADC_CTRL1_LRADC_IRQ_EN(TOUCHSCREEN_VCHANNEL1) | - LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL1), LRADC_CTRL1); + LRADC_CTRL1_LRADC_IRQ_EN(TOUCHSCREEN_VCHANNEL1) | + LRADC_CTRL1_LRADC_IRQ(TOUCHSCREEN_VCHANNEL1), LRADC_CTRL1); mxs_lradc_reg_set(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ_EN, LRADC_CTRL1); } @@ -771,25 +771,25 @@ static void mxs_lradc_handle_touch(struct mxs_lradc *lradc) if (mxs_lradc_check_touch_event(lradc)) mxs_lradc_start_touch_event(lradc); mxs_lradc_reg_clear(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ, - LRADC_CTRL1); + LRADC_CTRL1); return; case LRADC_SAMPLE_Y: lradc->ts_y_pos = mxs_lradc_read_raw_channel(lradc, - TOUCHSCREEN_VCHANNEL1); + TOUCHSCREEN_VCHANNEL1); mxs_lradc_prepare_x_pos(lradc); return; case LRADC_SAMPLE_X: lradc->ts_x_pos = mxs_lradc_read_raw_channel(lradc, - TOUCHSCREEN_VCHANNEL1); + TOUCHSCREEN_VCHANNEL1); mxs_lradc_prepare_pressure(lradc); return; case LRADC_SAMPLE_PRESSURE: lradc->ts_pressure = mxs_lradc_read_ts_pressure(lradc, - TOUCHSCREEN_VCHANNEL2, - TOUCHSCREEN_VCHANNEL1); + TOUCHSCREEN_VCHANNEL2, + TOUCHSCREEN_VCHANNEL1); mxs_lradc_complete_touch_event(lradc); return; @@ -826,20 +826,20 @@ static int mxs_lradc_read_single(struct iio_dev *iio_dev, int chan, int *val) */ if (lradc->soc == IMX28_LRADC) mxs_lradc_reg_clear(lradc, LRADC_CTRL1_LRADC_IRQ_EN(0), - LRADC_CTRL1); + LRADC_CTRL1); mxs_lradc_reg_clear(lradc, 0x1, LRADC_CTRL0); /* Enable / disable the divider per requirement */ if (test_bit(chan, &lradc->is_divided)) mxs_lradc_reg_set(lradc, 1 << LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET, - LRADC_CTRL2); + LRADC_CTRL2); else mxs_lradc_reg_clear(lradc, - 1 << LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET, LRADC_CTRL2); + 1 << LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET, LRADC_CTRL2); /* Clean the slot's previous content, then set new one. */ mxs_lradc_reg_clear(lradc, LRADC_CTRL4_LRADCSELECT_MASK(0), - LRADC_CTRL4); + LRADC_CTRL4); mxs_lradc_reg_set(lradc, chan, LRADC_CTRL4); mxs_lradc_reg_wrt(lradc, 0, LRADC_CH(0)); @@ -885,8 +885,8 @@ static int mxs_lradc_read_temp(struct iio_dev *iio_dev, int *val) } static int mxs_lradc_read_raw(struct iio_dev *iio_dev, - const struct iio_chan_spec *chan, - int *val, int *val2, long m) + const struct iio_chan_spec *chan, + int *val, int *val2, long m) { struct mxs_lradc *lradc = iio_priv(iio_dev); @@ -980,9 +980,9 @@ static int mxs_lradc_write_raw_get_fmt(struct iio_dev *iio_dev, } static ssize_t mxs_lradc_show_scale_available_ch(struct device *dev, - struct device_attribute *attr, - char *buf, - int ch) + struct device_attribute *attr, + char *buf, + int ch) { struct iio_dev *iio = dev_to_iio_dev(dev); struct mxs_lradc *lradc = iio_priv(iio); @@ -999,8 +999,8 @@ static ssize_t mxs_lradc_show_scale_available_ch(struct device *dev, } static ssize_t mxs_lradc_show_scale_available(struct device *dev, - struct device_attribute *attr, - char *buf) + struct device_attribute *attr, + char *buf) { struct iio_dev_attr *iio_attr = to_iio_dev_attr(attr); @@ -1275,8 +1275,8 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio) if (lradc->soc == IMX28_LRADC) mxs_lradc_reg_clear(lradc, - lradc->buffer_vchans << LRADC_CTRL1_LRADC_IRQ_EN_OFFSET, - LRADC_CTRL1); + lradc->buffer_vchans << LRADC_CTRL1_LRADC_IRQ_EN_OFFSET, + LRADC_CTRL1); mxs_lradc_reg_clear(lradc, lradc->buffer_vchans, LRADC_CTRL0); for_each_set_bit(chan, iio->active_scan_mask, LRADC_MAX_TOTAL_CHANS) { @@ -1289,12 +1289,12 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio) } mxs_lradc_reg_clear(lradc, LRADC_DELAY_TRIGGER_LRADCS_MASK | - LRADC_DELAY_KICK, LRADC_DELAY(0)); + LRADC_DELAY_KICK, LRADC_DELAY(0)); mxs_lradc_reg_clear(lradc, ctrl4_clr, LRADC_CTRL4); mxs_lradc_reg_set(lradc, ctrl4_set, LRADC_CTRL4); mxs_lradc_reg_set(lradc, ctrl1_irq, LRADC_CTRL1); mxs_lradc_reg_set(lradc, enable << LRADC_DELAY_TRIGGER_LRADCS_OFFSET, - LRADC_DELAY(0)); + LRADC_DELAY(0)); return 0; @@ -1308,13 +1308,13 @@ static int mxs_lradc_buffer_postdisable(struct iio_dev *iio) struct mxs_lradc *lradc = iio_priv(iio); mxs_lradc_reg_clear(lradc, LRADC_DELAY_TRIGGER_LRADCS_MASK | - LRADC_DELAY_KICK, LRADC_DELAY(0)); + LRADC_DELAY_KICK, LRADC_DELAY(0)); mxs_lradc_reg_clear(lradc, lradc->buffer_vchans, LRADC_CTRL0); if (lradc->soc == IMX28_LRADC) mxs_lradc_reg_clear(lradc, - lradc->buffer_vchans << LRADC_CTRL1_LRADC_IRQ_EN_OFFSET, - LRADC_CTRL1); + lradc->buffer_vchans << LRADC_CTRL1_LRADC_IRQ_EN_OFFSET, + LRADC_CTRL1); kfree(lradc->buffer); mutex_unlock(&lradc->lock); @@ -1323,7 +1323,7 @@ static int mxs_lradc_buffer_postdisable(struct iio_dev *iio) } static bool mxs_lradc_validate_scan_mask(struct iio_dev *iio, - const unsigned long *mask) + const unsigned long *mask) { struct mxs_lradc *lradc = iio_priv(iio); const int map_chans = bitmap_weight(mask, LRADC_MAX_TOTAL_CHANS); @@ -1476,11 +1476,11 @@ static int mxs_lradc_hw_init(struct mxs_lradc *lradc) /* Configure the touchscreen type */ if (lradc->soc == IMX28_LRADC) { mxs_lradc_reg_clear(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE, - LRADC_CTRL0); + LRADC_CTRL0); if (lradc->use_touchscreen == MXS_LRADC_TOUCHSCREEN_5WIRE) mxs_lradc_reg_set(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE, - LRADC_CTRL0); + LRADC_CTRL0); } /* Start internal temperature sensing. */ @@ -1507,13 +1507,13 @@ static const struct of_device_id mxs_lradc_dt_ids[] = { MODULE_DEVICE_TABLE(of, mxs_lradc_dt_ids); static int mxs_lradc_probe_touchscreen(struct mxs_lradc *lradc, - struct device_node *lradc_node) + struct device_node *lradc_node) { int ret; u32 ts_wires = 0, adapt; ret = of_property_read_u32(lradc_node, "fsl,lradc-touchscreen-wires", - &ts_wires); + &ts_wires); if (ret) return -ENODEV; /* touchscreen feature disabled */ @@ -1629,8 +1629,8 @@ static int mxs_lradc_probe(struct platform_device *pdev) } ret = devm_request_irq(dev, lradc->irq[i], - mxs_lradc_handle_irq, 0, - of_cfg->irq_name[i], iio); + mxs_lradc_handle_irq, 0, + of_cfg->irq_name[i], iio); if (ret) goto err_clk; } @@ -1657,8 +1657,8 @@ static int mxs_lradc_probe(struct platform_device *pdev) } ret = iio_triggered_buffer_setup(iio, &iio_pollfunc_store_time, - &mxs_lradc_trigger_handler, - &mxs_lradc_buffer_ops); + &mxs_lradc_trigger_handler, + &mxs_lradc_buffer_ops); if (ret) goto err_clk; diff --git a/drivers/staging/iio/adc/spear_adc.c b/drivers/staging/iio/adc/spear_adc.c index c538237..712cae0 100644 --- a/drivers/staging/iio/adc/spear_adc.c +++ b/drivers/staging/iio/adc/spear_adc.c @@ -191,8 +191,8 @@ static int spear_adc_write_raw(struct iio_dev *indio_dev, mutex_lock(&indio_dev->mlock); if ((val < SPEAR_ADC_CLK_MIN) || - (val > SPEAR_ADC_CLK_MAX) || - (val2 != 0)) { + (val > SPEAR_ADC_CLK_MAX) || + (val2 != 0)) { ret = -EINVAL; goto out; } -- 2.1.4 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [Outreachy kernel] [PATCH v2 2/9] staging: iio: adc: properly indent to match open paranthesis 2015-10-07 18:13 ` [PATCH v2 2/9] staging: iio: adc: properly indent to match open paranthesis Ioana Ciornei @ 2015-10-08 4:55 ` Sudip Mukherjee 2015-10-08 5:40 ` Julia Lawall 0 siblings, 1 reply; 17+ messages in thread From: Sudip Mukherjee @ 2015-10-08 4:55 UTC (permalink / raw) To: Ioana Ciornei; +Cc: outreachy-kernel On Wed, Oct 07, 2015 at 09:13:40PM +0300, Ioana Ciornei wrote: > Indent parameters ansd arguments passed to function calls to match > open paranthesis > > Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> > --- This patch will introduce new warning of "line over 80 characters" while fixing the warning about "Alignment should match open parenthesis". I am not sure if it is ok to introduce new warnings to fix some other warnings. In one of your change in this patch you can do something like: diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index fe56fb6..c30e1b3 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c @@ -359,8 +359,9 @@ static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO, ad7192_read_frequency, ad7192_write_frequency); -static ssize_t ad7192_show_scale_available(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t +ad7192_show_scale_available(struct device *dev, + struct device_attribute *attr, char *buf) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct ad7192_state *st = iio_priv(indio_dev); --- regards sudip ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [Outreachy kernel] [PATCH v2 2/9] staging: iio: adc: properly indent to match open paranthesis 2015-10-08 4:55 ` [Outreachy kernel] " Sudip Mukherjee @ 2015-10-08 5:40 ` Julia Lawall 2015-10-08 5:57 ` Ioana Ciornei 0 siblings, 1 reply; 17+ messages in thread From: Julia Lawall @ 2015-10-08 5:40 UTC (permalink / raw) To: Sudip Mukherjee; +Cc: Ioana Ciornei, outreachy-kernel On Thu, 8 Oct 2015, Sudip Mukherjee wrote: > On Wed, Oct 07, 2015 at 09:13:40PM +0300, Ioana Ciornei wrote: > > Indent parameters ansd arguments passed to function calls to match > > open paranthesis > > > > Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> > > --- > This patch will introduce new warning of "line over 80 characters" while > fixing the warning about "Alignment should match open parenthesis". > I am not sure if it is ok to introduce new warnings to fix some other > warnings. It would be best not to, espcially if it is all white space related. julia > In one of your change in this patch you can do something like: > > diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c > index fe56fb6..c30e1b3 100644 > --- a/drivers/staging/iio/adc/ad7192.c > +++ b/drivers/staging/iio/adc/ad7192.c > @@ -359,8 +359,9 @@ static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO, > ad7192_read_frequency, > ad7192_write_frequency); > > -static ssize_t ad7192_show_scale_available(struct device *dev, > - struct device_attribute *attr, char *buf) > +static ssize_t > +ad7192_show_scale_available(struct device *dev, > + struct device_attribute *attr, char *buf) > { > struct iio_dev *indio_dev = dev_to_iio_dev(dev); > struct ad7192_state *st = iio_priv(indio_dev); > > > --- > regards > sudip > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > To post to this group, send email to outreachy-kernel@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151008045556.GA3294%40sudip-pc. > For more options, visit https://groups.google.com/d/optout. > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [Outreachy kernel] [PATCH v2 2/9] staging: iio: adc: properly indent to match open paranthesis 2015-10-08 5:40 ` Julia Lawall @ 2015-10-08 5:57 ` Ioana Ciornei 2015-10-08 6:49 ` Julia Lawall 0 siblings, 1 reply; 17+ messages in thread From: Ioana Ciornei @ 2015-10-08 5:57 UTC (permalink / raw) To: Julia Lawall; +Cc: Sudip Mukherjee, outreachy-kernel On Thu, Oct 8, 2015 at 8:40 AM, Julia Lawall <julia.lawall@lip6.fr> wrote: > > > On Thu, 8 Oct 2015, Sudip Mukherjee wrote: > >> On Wed, Oct 07, 2015 at 09:13:40PM +0300, Ioana Ciornei wrote: >> > Indent parameters ansd arguments passed to function calls to match >> > open paranthesis >> > >> > Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> >> > --- >> This patch will introduce new warning of "line over 80 characters" while >> fixing the warning about "Alignment should match open parenthesis". >> I am not sure if it is ok to introduce new warnings to fix some other >> warnings. > > It would be best not to, espcially if it is all white space related. > I mentioned in the cover letter that this patch introduces checkpatch warnings in order to get your feedback on this. From my point of view, the readability has improved significantly with this patch but if you consider that it is not necessary I will discard those changes that create other warnings. Thanks, Ioana > >> In one of your change in this patch you can do something like: >> >> diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c >> index fe56fb6..c30e1b3 100644 >> --- a/drivers/staging/iio/adc/ad7192.c >> +++ b/drivers/staging/iio/adc/ad7192.c >> @@ -359,8 +359,9 @@ static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO, >> ad7192_read_frequency, >> ad7192_write_frequency); >> >> -static ssize_t ad7192_show_scale_available(struct device *dev, >> - struct device_attribute *attr, char *buf) >> +static ssize_t >> +ad7192_show_scale_available(struct device *dev, >> + struct device_attribute *attr, char *buf) >> { >> struct iio_dev *indio_dev = dev_to_iio_dev(dev); >> struct ad7192_state *st = iio_priv(indio_dev); >> >> >> --- >> regards >> sudip >> >> -- >> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. >> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. >> To post to this group, send email to outreachy-kernel@googlegroups.com. >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151008045556.GA3294%40sudip-pc. >> For more options, visit https://groups.google.com/d/optout. >> ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [Outreachy kernel] [PATCH v2 2/9] staging: iio: adc: properly indent to match open paranthesis 2015-10-08 5:57 ` Ioana Ciornei @ 2015-10-08 6:49 ` Julia Lawall 2015-10-08 6:52 ` Ioana Ciornei 0 siblings, 1 reply; 17+ messages in thread From: Julia Lawall @ 2015-10-08 6:49 UTC (permalink / raw) To: Ioana Ciornei; +Cc: Sudip Mukherjee, outreachy-kernel On Thu, 8 Oct 2015, Ioana Ciornei wrote: > On Thu, Oct 8, 2015 at 8:40 AM, Julia Lawall <julia.lawall@lip6.fr> wrote: > > > > > > On Thu, 8 Oct 2015, Sudip Mukherjee wrote: > > > >> On Wed, Oct 07, 2015 at 09:13:40PM +0300, Ioana Ciornei wrote: > >> > Indent parameters ansd arguments passed to function calls to match > >> > open paranthesis > >> > > >> > Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> > >> > --- > >> This patch will introduce new warning of "line over 80 characters" while > >> fixing the warning about "Alignment should match open parenthesis". > >> I am not sure if it is ok to introduce new warnings to fix some other > >> warnings. > > > > It would be best not to, espcially if it is all white space related. > > > > I mentioned in the cover letter that this patch introduces checkpatch > warnings in order to get your feedback on this. > From my point of view, the readability has improved significantly with > this patch but if you consider that it is not necessary > I will discard those changes that create other warnings. I don't have the patch in front of me, but can't you just fix the other warnings too? If it improves readability, it seems to be too bad ot lose the change. julia > > Thanks, > > Ioana > > > > > > > >> In one of your change in this patch you can do something like: > >> > >> diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c > >> index fe56fb6..c30e1b3 100644 > >> --- a/drivers/staging/iio/adc/ad7192.c > >> +++ b/drivers/staging/iio/adc/ad7192.c > >> @@ -359,8 +359,9 @@ static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO, > >> ad7192_read_frequency, > >> ad7192_write_frequency); > >> > >> -static ssize_t ad7192_show_scale_available(struct device *dev, > >> - struct device_attribute *attr, char *buf) > >> +static ssize_t > >> +ad7192_show_scale_available(struct device *dev, > >> + struct device_attribute *attr, char *buf) > >> { > >> struct iio_dev *indio_dev = dev_to_iio_dev(dev); > >> struct ad7192_state *st = iio_priv(indio_dev); > >> > >> > >> --- > >> regards > >> sudip > >> > >> -- > >> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > >> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > >> To post to this group, send email to outreachy-kernel@googlegroups.com. > >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151008045556.GA3294%40sudip-pc. > >> For more options, visit https://groups.google.com/d/optout. > >> > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [Outreachy kernel] [PATCH v2 2/9] staging: iio: adc: properly indent to match open paranthesis 2015-10-08 6:49 ` Julia Lawall @ 2015-10-08 6:52 ` Ioana Ciornei 2015-10-08 18:15 ` Ioana Ciornei 0 siblings, 1 reply; 17+ messages in thread From: Ioana Ciornei @ 2015-10-08 6:52 UTC (permalink / raw) To: Julia Lawall; +Cc: Sudip Mukherjee, outreachy-kernel On Thu, Oct 8, 2015 at 9:49 AM, Julia Lawall <julia.lawall@lip6.fr> wrote: > > > On Thu, 8 Oct 2015, Ioana Ciornei wrote: > >> On Thu, Oct 8, 2015 at 8:40 AM, Julia Lawall <julia.lawall@lip6.fr> wrote: >> > >> > >> > On Thu, 8 Oct 2015, Sudip Mukherjee wrote: >> > >> >> On Wed, Oct 07, 2015 at 09:13:40PM +0300, Ioana Ciornei wrote: >> >> > Indent parameters ansd arguments passed to function calls to match >> >> > open paranthesis >> >> > >> >> > Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> >> >> > --- >> >> This patch will introduce new warning of "line over 80 characters" while >> >> fixing the warning about "Alignment should match open parenthesis". >> >> I am not sure if it is ok to introduce new warnings to fix some other >> >> warnings. >> > >> > It would be best not to, espcially if it is all white space related. >> > >> >> I mentioned in the cover letter that this patch introduces checkpatch >> warnings in order to get your feedback on this. >> From my point of view, the readability has improved significantly with >> this patch but if you consider that it is not necessary >> I will discard those changes that create other warnings. > > I don't have the patch in front of me, but can't you just fix the other > warnings too? If it improves readability, it seems to be too bad ot lose > the change. > I will have a try. Thanks, Ioana >> >> >> >> > >> >> In one of your change in this patch you can do something like: >> >> >> >> diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c >> >> index fe56fb6..c30e1b3 100644 >> >> --- a/drivers/staging/iio/adc/ad7192.c >> >> +++ b/drivers/staging/iio/adc/ad7192.c >> >> @@ -359,8 +359,9 @@ static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO, >> >> ad7192_read_frequency, >> >> ad7192_write_frequency); >> >> >> >> -static ssize_t ad7192_show_scale_available(struct device *dev, >> >> - struct device_attribute *attr, char *buf) >> >> +static ssize_t >> >> +ad7192_show_scale_available(struct device *dev, >> >> + struct device_attribute *attr, char *buf) >> >> { >> >> struct iio_dev *indio_dev = dev_to_iio_dev(dev); >> >> struct ad7192_state *st = iio_priv(indio_dev); >> >> >> >> >> >> --- >> >> regards >> >> sudip >> >> >> >> -- >> >> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. >> >> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. >> >> To post to this group, send email to outreachy-kernel@googlegroups.com. >> >> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151008045556.GA3294%40sudip-pc. >> >> For more options, visit https://groups.google.com/d/optout. >> >> >> ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [Outreachy kernel] [PATCH v2 2/9] staging: iio: adc: properly indent to match open paranthesis 2015-10-08 6:52 ` Ioana Ciornei @ 2015-10-08 18:15 ` Ioana Ciornei 2015-10-09 5:40 ` Sudip Mukherjee 0 siblings, 1 reply; 17+ messages in thread From: Ioana Ciornei @ 2015-10-08 18:15 UTC (permalink / raw) To: Julia Lawall; +Cc: Sudip Mukherjee, outreachy-kernel On Thu, Oct 8, 2015 at 9:52 AM, Ioana Ciornei <ciorneiioana@gmail.com> wrote: > On Thu, Oct 8, 2015 at 9:49 AM, Julia Lawall <julia.lawall@lip6.fr> wrote: >> >> >> On Thu, 8 Oct 2015, Ioana Ciornei wrote: >> >>> On Thu, Oct 8, 2015 at 8:40 AM, Julia Lawall <julia.lawall@lip6.fr> wrote: >>> > >>> > >>> > On Thu, 8 Oct 2015, Sudip Mukherjee wrote: >>> > >>> >> On Wed, Oct 07, 2015 at 09:13:40PM +0300, Ioana Ciornei wrote: >>> >> > Indent parameters ansd arguments passed to function calls to match >>> >> > open paranthesis >>> >> > >>> >> > Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> >>> >> > --- >>> >> This patch will introduce new warning of "line over 80 characters" while >>> >> fixing the warning about "Alignment should match open parenthesis". >>> >> I am not sure if it is ok to introduce new warnings to fix some other >>> >> warnings. >>> > >>> > It would be best not to, espcially if it is all white space related. >>> > >>> >>> I mentioned in the cover letter that this patch introduces checkpatch >>> warnings in order to get your feedback on this. >>> From my point of view, the readability has improved significantly with >>> this patch but if you consider that it is not necessary >>> I will discard those changes that create other warnings. >> >> I don't have the patch in front of me, but can't you just fix the other >> warnings too? If it improves readability, it seems to be too bad ot lose >> the change. >> I had a better look at this particular patch and I am still in doubt about this one. If a indent to match the open brackets I do not see a possible way to not cross the 80 characters limit. I had a try with Sudip's sugestion to put the return type of a function on a separate line but that does not apply to all cases. What should I do in this situation? It is better to just leave the changes that do not introduce warnings or just drop the patch? Thanks, Ioana ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [Outreachy kernel] [PATCH v2 2/9] staging: iio: adc: properly indent to match open paranthesis 2015-10-08 18:15 ` Ioana Ciornei @ 2015-10-09 5:40 ` Sudip Mukherjee 0 siblings, 0 replies; 17+ messages in thread From: Sudip Mukherjee @ 2015-10-09 5:40 UTC (permalink / raw) To: Ioana Ciornei; +Cc: Julia Lawall, outreachy-kernel On Thu, Oct 08, 2015 at 09:15:04PM +0300, Ioana Ciornei wrote: > On Thu, Oct 8, 2015 at 9:52 AM, Ioana Ciornei <ciorneiioana@gmail.com> wrote: > > On Thu, Oct 8, 2015 at 9:49 AM, Julia Lawall <julia.lawall@lip6.fr> wrote: > >> > >> > >> On Thu, 8 Oct 2015, Ioana Ciornei wrote: > >> > >>> On Thu, Oct 8, 2015 at 8:40 AM, Julia Lawall <julia.lawall@lip6.fr> wrote: > >>> > > >>> > > >>> > On Thu, 8 Oct 2015, Sudip Mukherjee wrote: > >>> > > >>> >> On Wed, Oct 07, 2015 at 09:13:40PM +0300, Ioana Ciornei wrote: <snip> > >> > > I had a better look at this particular patch and I am still in doubt > about this one. > If a indent to match the open brackets I do not see a possible way to > not cross the 80 characters limit. > > I had a try with Sudip's sugestion to put the return type of a > function on a separate line but that does not apply to all cases. > What should I do in this situation? It is better to just leave the > changes that do not introduce warnings or just drop the patch? I just did one as an example to show you one more way of keeping the lines in limit. But for other cases where there is no way then you can either rename the variables (if variable names are long) or you can refactor the code so that indention is fixed along with that line length is also fixed and lastly if there is no possible way then I guess we should chose the one which improves readability. regards sudip ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 3/9] staging: iio: adc: remove explicit comparison to NULL 2015-10-07 18:13 [PATCH v2 0/9] staging: iio: adc: fix multiple checkpatch issues Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 1/9] staging: iio: adc: use kernel types u32 and u64 Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 2/9] staging: iio: adc: properly indent to match open paranthesis Ioana Ciornei @ 2015-10-07 18:13 ` Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 4/9] staging: iio: adc: remove space after cast Ioana Ciornei ` (5 subsequent siblings) 8 siblings, 0 replies; 17+ messages in thread From: Ioana Ciornei @ 2015-10-07 18:13 UTC (permalink / raw) To: outreachy-kernel; +Cc: Ioana Ciornei Use !condition instead off condition == NULL when comparing with NULL Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> --- Changes in v2: - nothing drivers/staging/iio/adc/ad7192.c | 2 +- drivers/staging/iio/adc/ad7280a.c | 8 ++++---- drivers/staging/iio/adc/mxs-lradc.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index 21d83c5..22b4bf5 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c @@ -625,7 +625,7 @@ static int ad7192_probe(struct spi_device *spi) } indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); - if (indio_dev == NULL) + if (!indio_dev) return -ENOMEM; st = iio_priv(indio_dev); diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index 26c9c12..9fb664c 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -488,7 +488,7 @@ static int ad7280_channel_init(struct ad7280_state *st) st->channels = kcalloc((st->slave_num + 1) * 12 + 2, sizeof(*st->channels), GFP_KERNEL); - if (st->channels == NULL) + if (!st->channels) return -ENOMEM; for (dev = 0, cnt = 0; dev <= st->slave_num; dev++) @@ -549,7 +549,7 @@ static int ad7280_attr_init(struct ad7280_state *st) st->iio_attr = kcalloc(2, sizeof(*st->iio_attr) * (st->slave_num + 1) * AD7280A_CELLS_PER_DEV, GFP_KERNEL); - if (st->iio_attr == NULL) + if (!st->iio_attr) return -ENOMEM; for (dev = 0, cnt = 0; dev <= st->slave_num; dev++) @@ -685,7 +685,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private) int i, ret; channels = kcalloc(st->scan_cnt, sizeof(*channels), GFP_KERNEL); - if (channels == NULL) + if (!channels) return IRQ_HANDLED; ret = ad7280_read_all_channels(st, st->scan_cnt, channels); @@ -838,7 +838,7 @@ static int ad7280_probe(struct spi_device *spi) struct iio_dev *indio_dev; indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); - if (indio_dev == NULL) + if (!indio_dev) return -ENOMEM; st = iio_priv(indio_dev); diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c index 208f928..cde7b3a 100644 --- a/drivers/staging/iio/adc/mxs-lradc.c +++ b/drivers/staging/iio/adc/mxs-lradc.c @@ -1217,7 +1217,7 @@ static int mxs_lradc_trigger_init(struct iio_dev *iio) struct mxs_lradc *lradc = iio_priv(iio); trig = iio_trigger_alloc("%s-dev%i", iio->name, iio->id); - if (trig == NULL) + if (!trig) return -ENOMEM; trig->dev.parent = lradc->dev; -- 2.1.4 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 4/9] staging: iio: adc: remove space after cast 2015-10-07 18:13 [PATCH v2 0/9] staging: iio: adc: fix multiple checkpatch issues Ioana Ciornei ` (2 preceding siblings ...) 2015-10-07 18:13 ` [PATCH v2 3/9] staging: iio: adc: remove explicit comparison to NULL Ioana Ciornei @ 2015-10-07 18:13 ` Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 5/9] staging: iio: adc: add spaces around binary operators Ioana Ciornei ` (4 subsequent siblings) 8 siblings, 0 replies; 17+ messages in thread From: Ioana Ciornei @ 2015-10-07 18:13 UTC (permalink / raw) To: outreachy-kernel; +Cc: Ioana Ciornei Remove the space after an explicit cast because there is no point in having it Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> --- Changes in v2: - nothing drivers/staging/iio/adc/ad7192.c | 2 +- drivers/staging/iio/adc/ad7280a.c | 6 +++--- drivers/staging/iio/adc/ad7606_core.c | 2 +- drivers/staging/iio/adc/ad7606_par.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index 22b4bf5..ab87724 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c @@ -423,7 +423,7 @@ static ssize_t ad7192_set(struct device *dev, return -EBUSY; } - switch ((u32) this_attr->address) { + switch ((u32)this_attr->address) { case AD7192_REG_GPOCON: if (val) st->gpocon |= AD7192_GPOCON_BPDSW; diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index 9fb664c..ad1a44f 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -602,7 +602,7 @@ static ssize_t ad7280_read_channel_config(struct device *dev, struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); unsigned val; - switch ((u32) this_attr->address) { + switch ((u32)this_attr->address) { case AD7280A_CELL_OVERVOLTAGE: val = 1000 + (st->cell_threshhigh * 1568) / 100; break; @@ -638,7 +638,7 @@ static ssize_t ad7280_write_channel_config(struct device *dev, if (ret) return ret; - switch ((u32) this_attr->address) { + switch ((u32)this_attr->address) { case AD7280A_CELL_OVERVOLTAGE: case AD7280A_CELL_UNDERVOLTAGE: val = ((val - 1000) * 100) / 1568; /* LSB 15.68mV */ @@ -654,7 +654,7 @@ static ssize_t ad7280_write_channel_config(struct device *dev, val = clamp(val, 0L, 0xFFL); mutex_lock(&indio_dev->mlock); - switch ((u32) this_attr->address) { + switch ((u32)this_attr->address) { case AD7280A_CELL_OVERVOLTAGE: st->cell_threshhigh = val; break; diff --git a/drivers/staging/iio/adc/ad7606_core.c b/drivers/staging/iio/adc/ad7606_core.c index 6dc7413..eb890b6 100644 --- a/drivers/staging/iio/adc/ad7606_core.c +++ b/drivers/staging/iio/adc/ad7606_core.c @@ -97,7 +97,7 @@ static int ad7606_read_raw(struct iio_dev *indio_dev, if (ret < 0) return ret; - *val = (short) ret; + *val = (short)ret; return IIO_VAL_INT; case IIO_CHAN_INFO_SCALE: *val = st->range * 2; diff --git a/drivers/staging/iio/adc/ad7606_par.c b/drivers/staging/iio/adc/ad7606_par.c index fbe8237..3537a78 100644 --- a/drivers/staging/iio/adc/ad7606_par.c +++ b/drivers/staging/iio/adc/ad7606_par.c @@ -22,7 +22,7 @@ static int ad7606_par16_read_block(struct device *dev, struct iio_dev *indio_dev = platform_get_drvdata(pdev); struct ad7606_state *st = iio_priv(indio_dev); - insw((unsigned long) st->base_address, buf, count); + insw((unsigned long)st->base_address, buf, count); return 0; } @@ -38,7 +38,7 @@ static int ad7606_par8_read_block(struct device *dev, struct iio_dev *indio_dev = platform_get_drvdata(pdev); struct ad7606_state *st = iio_priv(indio_dev); - insb((unsigned long) st->base_address, buf, count * 2); + insb((unsigned long)st->base_address, buf, count * 2); return 0; } -- 2.1.4 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 5/9] staging: iio: adc: add spaces around binary operators 2015-10-07 18:13 [PATCH v2 0/9] staging: iio: adc: fix multiple checkpatch issues Ioana Ciornei ` (3 preceding siblings ...) 2015-10-07 18:13 ` [PATCH v2 4/9] staging: iio: adc: remove space after cast Ioana Ciornei @ 2015-10-07 18:13 ` Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 6/9] staging: iio: adc: add blank line after declarations Ioana Ciornei ` (3 subsequent siblings) 8 siblings, 0 replies; 17+ messages in thread From: Ioana Ciornei @ 2015-10-07 18:13 UTC (permalink / raw) To: outreachy-kernel; +Cc: Ioana Ciornei Add spaces around binary operators like -, +, * etc in order to improve readability Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> --- Changes in v2: - nothing drivers/staging/iio/adc/ad7192.c | 2 +- drivers/staging/iio/adc/ad7280a.c | 4 ++-- drivers/staging/iio/adc/ad7816.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index ab87724..495ddb6 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c @@ -376,7 +376,7 @@ static ssize_t ad7192_show_scale_available(struct device *dev, } static IIO_DEVICE_ATTR_NAMED(in_v_m_v_scale_available, - in_voltage-voltage_scale_available, + in_voltage - voltage_scale_available, S_IRUGO, ad7192_show_scale_available, NULL, 0); static IIO_DEVICE_ATTR(in_voltage_scale_available, S_IRUGO, diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index ad1a44f..8d9e7f7 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -740,14 +740,14 @@ out: } static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value, - in_voltage-voltage_thresh_low_value, + in_voltage - voltage_thresh_low_value, S_IRUGO | S_IWUSR, ad7280_read_channel_config, ad7280_write_channel_config, AD7280A_CELL_UNDERVOLTAGE); static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value, - in_voltage-voltage_thresh_high_value, + in_voltage - voltage_thresh_high_value, S_IRUGO | S_IWUSR, ad7280_read_channel_config, ad7280_write_channel_config, diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c index 4e954d2..6636087 100644 --- a/drivers/staging/iio/adc/ad7816.c +++ b/drivers/staging/iio/adc/ad7816.c @@ -48,7 +48,7 @@ struct ad7816_chip_info { u16 rdwr_pin; u16 convert_pin; u16 busy_pin; - u8 oti_data[AD7816_CS_MAX+1]; + u8 oti_data[AD7816_CS_MAX + 1]; u8 channel_id; /* 0 always be temperature */ u8 mode; }; -- 2.1.4 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 6/9] staging: iio: adc: add blank line after declarations 2015-10-07 18:13 [PATCH v2 0/9] staging: iio: adc: fix multiple checkpatch issues Ioana Ciornei ` (4 preceding siblings ...) 2015-10-07 18:13 ` [PATCH v2 5/9] staging: iio: adc: add spaces around binary operators Ioana Ciornei @ 2015-10-07 18:13 ` Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 7/9] staging: iio: adc: remove multiple blank lines Ioana Ciornei ` (2 subsequent siblings) 8 siblings, 0 replies; 17+ messages in thread From: Ioana Ciornei @ 2015-10-07 18:13 UTC (permalink / raw) To: outreachy-kernel; +Cc: Ioana Ciornei Insert a blank line after declarations Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> --- Changes in v2: - nothing drivers/staging/iio/adc/ad7606_par.c | 1 + drivers/staging/iio/adc/ad7606_spi.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/staging/iio/adc/ad7606_par.c b/drivers/staging/iio/adc/ad7606_par.c index 3537a78..adc370e 100644 --- a/drivers/staging/iio/adc/ad7606_par.c +++ b/drivers/staging/iio/adc/ad7606_par.c @@ -113,6 +113,7 @@ static const struct dev_pm_ops ad7606_pm_ops = { .suspend = ad7606_par_suspend, .resume = ad7606_par_resume, }; + #define AD7606_PAR_PM_OPS (&ad7606_pm_ops) #else diff --git a/drivers/staging/iio/adc/ad7606_spi.c b/drivers/staging/iio/adc/ad7606_spi.c index 9c62e94..b88f882 100644 --- a/drivers/staging/iio/adc/ad7606_spi.c +++ b/drivers/staging/iio/adc/ad7606_spi.c @@ -85,6 +85,7 @@ static const struct dev_pm_ops ad7606_pm_ops = { .suspend = ad7606_spi_suspend, .resume = ad7606_spi_resume, }; + #define AD7606_SPI_PM_OPS (&ad7606_pm_ops) #else -- 2.1.4 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 7/9] staging: iio: adc: remove multiple blank lines 2015-10-07 18:13 [PATCH v2 0/9] staging: iio: adc: fix multiple checkpatch issues Ioana Ciornei ` (5 preceding siblings ...) 2015-10-07 18:13 ` [PATCH v2 6/9] staging: iio: adc: add blank line after declarations Ioana Ciornei @ 2015-10-07 18:13 ` Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 8/9] staging: iio: adc: remove the use of CamelCase Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 9/9] staging: iio: adc: properly indent block comments Ioana Ciornei 8 siblings, 0 replies; 17+ messages in thread From: Ioana Ciornei @ 2015-10-07 18:13 UTC (permalink / raw) To: outreachy-kernel; +Cc: Ioana Ciornei Remove multiple blank lines since there is no practical reason to have it Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> --- Changes in v2: - nothing drivers/staging/iio/adc/ad7192.c | 1 - drivers/staging/iio/adc/ad7280a.c | 1 - drivers/staging/iio/adc/ad7780.c | 1 - drivers/staging/iio/adc/ad7816.c | 3 --- 4 files changed, 6 deletions(-) diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index 495ddb6..f293dbd 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c @@ -88,7 +88,6 @@ #define AD7192_CLK_INT_CO 3 /* Internal 4.92 MHz Clock available * at the MCLK2 pin */ - /* Configuration Register Bit Designations (AD7192_REG_CONF) */ #define AD7192_CONF_CHOP BIT(23) /* CHOP enable */ diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index 8d9e7f7..828bd57 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -765,7 +765,6 @@ static IIO_DEVICE_ATTR(in_temp_thresh_high_value, ad7280_write_channel_config, AD7280A_AUX_ADC_OVERVOLTAGE); - static struct attribute *ad7280_event_attributes[] = { &iio_dev_attr_in_thresh_low_value.dev_attr.attr, &iio_dev_attr_in_thresh_high_value.dev_attr.attr, diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c index 501dc9f..6be979a 100644 --- a/drivers/staging/iio/adc/ad7780.c +++ b/drivers/staging/iio/adc/ad7780.c @@ -206,7 +206,6 @@ static int ad7780_probe(struct spi_device *spi) indio_dev->info = &ad7780_info; if (pdata && gpio_is_valid(pdata->gpio_pdrst)) { - ret = devm_gpio_request_one(&spi->dev, pdata->gpio_pdrst, GPIOF_OUT_INIT_LOW, "AD7780 /PDRST"); if (ret) { diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c index 6636087..b3dec706 100644 --- a/drivers/staging/iio/adc/ad7816.c +++ b/drivers/staging/iio/adc/ad7816.c @@ -38,7 +38,6 @@ #define AD7816_TEMP_FLOAT_OFFSET 2 #define AD7816_TEMP_FLOAT_MASK 0x3 - /* * struct ad7816_chip_info - chip specific information */ @@ -70,7 +69,6 @@ static int ad7816_spi_read(struct ad7816_chip_info *chip, u16 *data) } gpio_set_value(chip->rdwr_pin, 1); - if (chip->mode == AD7816_PD) { /* operating mode 2 */ gpio_set_value(chip->convert_pin, 1); gpio_set_value(chip->convert_pin, 0); @@ -203,7 +201,6 @@ static IIO_DEVICE_ATTR(channel, S_IRUGO | S_IWUSR, ad7816_store_channel, 0); - static ssize_t ad7816_show_value(struct device *dev, struct device_attribute *attr, char *buf) -- 2.1.4 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 8/9] staging: iio: adc: remove the use of CamelCase 2015-10-07 18:13 [PATCH v2 0/9] staging: iio: adc: fix multiple checkpatch issues Ioana Ciornei ` (6 preceding siblings ...) 2015-10-07 18:13 ` [PATCH v2 7/9] staging: iio: adc: remove multiple blank lines Ioana Ciornei @ 2015-10-07 18:13 ` Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 9/9] staging: iio: adc: properly indent block comments Ioana Ciornei 8 siblings, 0 replies; 17+ messages in thread From: Ioana Ciornei @ 2015-10-07 18:13 UTC (permalink / raw) To: outreachy-kernel; +Cc: Ioana Ciornei Remove the use of CamelCase to follow the kernel naming conventions Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> --- Changes in v2: - remove change added by mistake in v1 drivers/staging/iio/adc/ad7192.c | 10 +++++----- drivers/staging/iio/adc/ad7192.h | 2 +- drivers/staging/iio/adc/ad7280a.c | 14 +++++++------- drivers/staging/iio/adc/lpc32xx_adc.c | 6 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index f293dbd..c849307 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c @@ -124,7 +124,7 @@ #define AD7192_GPOCON_P1DAT BIT(1) /* P1 state */ #define AD7192_GPOCON_P0DAT BIT(0) /* P0 state */ -#define AD7192_INT_FREQ_MHz 4915200 +#define AD7192_INT_FREQ_MHZ 4915200 /* NOTE: * The AD7190/2/5 features a dual use data out ready DOUT/RDY output. @@ -228,14 +228,14 @@ static int ad7192_setup(struct ad7192_state *st, switch (pdata->clock_source_sel) { case AD7192_CLK_EXT_MCLK1_2: case AD7192_CLK_EXT_MCLK2: - st->mclk = AD7192_INT_FREQ_MHz; + st->mclk = AD7192_INT_FREQ_MHZ; break; case AD7192_CLK_INT: case AD7192_CLK_INT_CO: - if (pdata->ext_clk_Hz) - st->mclk = pdata->ext_clk_Hz; + if (pdata->ext_clk_hz) + st->mclk = pdata->ext_clk_hz; else - st->mclk = AD7192_INT_FREQ_MHz; + st->mclk = AD7192_INT_FREQ_MHZ; break; default: ret = -EINVAL; diff --git a/drivers/staging/iio/adc/ad7192.h b/drivers/staging/iio/adc/ad7192.h index a0a5b61..7433a43 100644 --- a/drivers/staging/iio/adc/ad7192.h +++ b/drivers/staging/iio/adc/ad7192.h @@ -34,7 +34,7 @@ struct ad7192_platform_data { u16 vref_mv; u8 clock_source_sel; - u32 ext_clk_Hz; + u32 ext_clk_hz; bool refin2_en; bool rej60_en; bool sinc3_en; diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index 828bd57..5ae9455 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -89,7 +89,7 @@ #define AD7280A_ALL_CELLS (0xAD << 16) -#define AD7280A_MAX_SPI_CLK_Hz 700000 /* < 1MHz */ +#define AD7280A_MAX_SPI_CLK_HZ 700000 /* < 1MHz */ #define AD7280A_MAX_CHAIN 8 #define AD7280A_CELLS_PER_DEV 6 #define AD7280A_BITS 12 @@ -832,8 +832,8 @@ static int ad7280_probe(struct spi_device *spi) const struct ad7280_platform_data *pdata = spi->dev.platform_data; struct ad7280_state *st; int ret; - const unsigned short tACQ_ns[4] = {465, 1010, 1460, 1890}; - const unsigned short nAVG[4] = {1, 2, 4, 8}; + const unsigned short tacq_ns[4] = {465, 1010, 1460, 1890}; + const unsigned short navg[4] = {1, 2, 4, 8}; struct iio_dev *indio_dev; indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); @@ -849,7 +849,7 @@ static int ad7280_probe(struct spi_device *spi) ad7280_crc8_build_table(st->crc_tab); - st->spi->max_speed_hz = AD7280A_MAX_SPI_CLK_Hz; + st->spi->max_speed_hz = AD7280A_MAX_SPI_CLK_HZ; st->spi->mode = SPI_MODE_1; spi_setup(st->spi); @@ -876,9 +876,9 @@ static int ad7280_probe(struct spi_device *spi) */ st->readback_delay_us = - ((tACQ_ns[pdata->acquisition_time & 0x3] + 695) * - (AD7280A_NUM_CH * nAVG[pdata->conversion_averaging & 0x3])) - - tACQ_ns[pdata->acquisition_time & 0x3] + + ((tacq_ns[pdata->acquisition_time & 0x3] + 695) * + (AD7280A_NUM_CH * navg[pdata->conversion_averaging & 0x3])) + - tacq_ns[pdata->acquisition_time & 0x3] + st->slave_num * 250; /* Convert to usecs */ diff --git a/drivers/staging/iio/adc/lpc32xx_adc.c b/drivers/staging/iio/adc/lpc32xx_adc.c index d11c54b..b411e0b 100644 --- a/drivers/staging/iio/adc/lpc32xx_adc.c +++ b/drivers/staging/iio/adc/lpc32xx_adc.c @@ -43,8 +43,8 @@ #define LPC32XX_ADC_VALUE(x) ((x) + 0x48) /* Bit definitions for LPC32XX_ADC_SELECT: */ -#define AD_REFm 0x00000200 /* constant, always write this value! */ -#define AD_REFp 0x00000080 /* constant, always write this value! */ +#define AD_REFM 0x00000200 /* constant, always write this value! */ +#define AD_REFP 0x00000080 /* constant, always write this value! */ #define AD_IN 0x00000010 /* multiple of this is the */ /* channel number: 0, 1, 2 */ #define AD_INTERNAL 0x00000004 /* constant, always write this value! */ @@ -78,7 +78,7 @@ static int lpc32xx_read_raw(struct iio_dev *indio_dev, mutex_lock(&indio_dev->mlock); clk_enable(info->clk); /* Measurement setup */ - __raw_writel(AD_INTERNAL | (chan->address) | AD_REFp | AD_REFm, + __raw_writel(AD_INTERNAL | (chan->address) | AD_REFP | AD_REFM, LPC32XX_ADC_SELECT(info->adc_base)); /* Trigger conversion */ __raw_writel(AD_PDN_CTRL | AD_STROBE, -- 2.1.4 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 9/9] staging: iio: adc: properly indent block comments 2015-10-07 18:13 [PATCH v2 0/9] staging: iio: adc: fix multiple checkpatch issues Ioana Ciornei ` (7 preceding siblings ...) 2015-10-07 18:13 ` [PATCH v2 8/9] staging: iio: adc: remove the use of CamelCase Ioana Ciornei @ 2015-10-07 18:13 ` Ioana Ciornei 8 siblings, 0 replies; 17+ messages in thread From: Ioana Ciornei @ 2015-10-07 18:13 UTC (permalink / raw) To: outreachy-kernel; +Cc: Ioana Ciornei Rework block comments in order to follow kernel coding style Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> --- Changes in v2: -nothing drivers/staging/iio/adc/ad7192.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index c849307..d97f116 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c @@ -35,10 +35,14 @@ #define AD7192_REG_DATA 3 /* Data Register (RO, 24/32-bit) */ #define AD7192_REG_ID 4 /* ID Register (RO, 8-bit) */ #define AD7192_REG_GPOCON 5 /* GPOCON Register (RO, 8-bit) */ -#define AD7192_REG_OFFSET 6 /* Offset Register (RW, 16-bit - * (AD7792)/24-bit (AD7192)) */ -#define AD7192_REG_FULLSALE 7 /* Full-Scale Register - * (RW, 16-bit (AD7792)/24-bit (AD7192)) */ +#define AD7192_REG_OFFSET 6 /* + * Offset Register (RW, 16-bit + * (AD7792)/24-bit (AD7192)) + */ +#define AD7192_REG_FULLSALE 7 /* + * Full-Scale Register + * (RW, 16-bit (AD7792)/24-bit (AD7192)) + */ /* Communications Register Bit Designations (AD7192_REG_COMM) */ #define AD7192_COMM_WEN BIT(7) /* Write Enable */ @@ -80,13 +84,19 @@ #define AD7192_MODE_CAL_SYS_FULL 7 /* System Full-Scale Calibration */ /* Mode Register: AD7192_MODE_CLKSRC options */ -#define AD7192_CLK_EXT_MCLK1_2 0 /* External 4.92 MHz Clock connected - * from MCLK1 to MCLK2 */ +#define AD7192_CLK_EXT_MCLK1_2 0 /* + * External 4.92 MHz Clock connected + * from MCLK1 to MCLK2 + */ #define AD7192_CLK_EXT_MCLK2 1 /* External Clock applied to MCLK2 */ -#define AD7192_CLK_INT 2 /* Internal 4.92 MHz Clock not - * available at the MCLK2 pin */ -#define AD7192_CLK_INT_CO 3 /* Internal 4.92 MHz Clock available - * at the MCLK2 pin */ +#define AD7192_CLK_INT 2 /* + * Internal 4.92 MHz Clock not + * available at the MCLK2 pin + */ +#define AD7192_CLK_INT_CO 3 /* + * Internal 4.92 MHz Clock available + * at the MCLK2 pin + */ /* Configuration Register Bit Designations (AD7192_REG_CONF) */ -- 2.1.4 ^ permalink raw reply related [flat|nested] 17+ messages in thread
end of thread, other threads:[~2015-10-09 5:40 UTC | newest] Thread overview: 17+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-10-07 18:13 [PATCH v2 0/9] staging: iio: adc: fix multiple checkpatch issues Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 1/9] staging: iio: adc: use kernel types u32 and u64 Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 2/9] staging: iio: adc: properly indent to match open paranthesis Ioana Ciornei 2015-10-08 4:55 ` [Outreachy kernel] " Sudip Mukherjee 2015-10-08 5:40 ` Julia Lawall 2015-10-08 5:57 ` Ioana Ciornei 2015-10-08 6:49 ` Julia Lawall 2015-10-08 6:52 ` Ioana Ciornei 2015-10-08 18:15 ` Ioana Ciornei 2015-10-09 5:40 ` Sudip Mukherjee 2015-10-07 18:13 ` [PATCH v2 3/9] staging: iio: adc: remove explicit comparison to NULL Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 4/9] staging: iio: adc: remove space after cast Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 5/9] staging: iio: adc: add spaces around binary operators Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 6/9] staging: iio: adc: add blank line after declarations Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 7/9] staging: iio: adc: remove multiple blank lines Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 8/9] staging: iio: adc: remove the use of CamelCase Ioana Ciornei 2015-10-07 18:13 ` [PATCH v2 9/9] staging: iio: adc: properly indent block comments Ioana Ciornei
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.