Skip to contentSkip to conversation

staging: iio: adc: fix multiple checkpatch issues

PATCH In review Ioana Ciornei 2 participants 20 messages Oct 14, 2015

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

v4 cover staging: iio: adc: fix multiple checkpatch issues

This patchset fixes multiple checkpatch issues.

Changes in v2:
- removed commit 09/10 from previous version since it introduced build warnings

Changes in v3:
- reworked patch 2/9 so that it does not introduce any other checkpatch warnings
- changed the cover letter description in order to keep up with the other updates

Changes in v4:
- reworked patch 2/9 in order to follow kernel coding style
- changed patch 5/9 in order to not break user space
- reworked patch 8/9 because abbreviations are not considered camel case
- changed patch 9/9 by moving block comment above the macro def

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      |  97 ++++++++++--------
 drivers/staging/iio/adc/ad7192.h      |   2 +-
 drivers/staging/iio/adc/ad7280a.c     | 178 ++++++++++++++++----------------
 drivers/staging/iio/adc/ad7606_core.c |  23 +++--
 drivers/staging/iio/adc/ad7606_par.c  |  15 +--
 drivers/staging/iio/adc/ad7606_spi.c  |   5 +-
 drivers/staging/iio/adc/ad7780.c      |  13 +--
 drivers/staging/iio/adc/ad7816.c      |  53 +++++-----
 drivers/staging/iio/adc/lpc32xx_adc.c |  14 +--
 drivers/staging/iio/adc/mxs-lradc.c   | 185 +++++++++++++++++++---------------
 drivers/staging/iio/adc/spear_adc.c   |   4 +-
 11 files changed, 313 insertions(+), 276 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH v4 1/9 staging: iio: adc: use kernel types u32 and u64

Convert uint32_t to u32 and uint64_t to u64 in order to follow the kernel best practice

---
Changes in v2:
- nothing
Changes in v3:
- nothing
Changes in v4:
- nothing

 drivers/staging/iio/adc/mxs-lradc.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/staging/iio/adc/mxs-lradc.c +15 -15
index 3f7715c..d88d85b 100644
@@ -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));
Signature · 1 line
2.1.4
Reviewed-by on v4 1/9
#2 lore raw

Re: [Outreachy kernel] [PATCH v4 1/9] staging: iio: adc: use kernel types u32 and u64

Quoted 4 lines · Ioana Ciornei

Convert uint32_t to u32 and uint64_t to u64 in order to follow the kernel best practice

Quoted 128 lines

---
Changes in v2:
- nothing
Changes in v3:
- nothing
Changes in v4:
- nothing

 drivers/staging/iio/adc/mxs-lradc.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/staging/iio/adc/mxs-lradc.c +15 -16
index 3f7715c..d88d85b 100644
@@ -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

--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/07227314a59d28452e0ffb45923b525ea398f00c.1444845354.git.ciorneiioana%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#3 lore raw

PATCH v4 2/9 staging: iio: adc: properly indent to match open paranthesis

In reply to Ioana Ciornei

Indent parameters and arguments passed to function calls to match open paranthesis

---
Changes in v2:
- nothing
Changes in v3:
- rework changes in order to avoid introducing new checkpatch warnings
Changes in v4:
- change the position of arguments in order to follow kernel coding style

 drivers/staging/iio/adc/ad7192.c      |  47 +++++-----
 drivers/staging/iio/adc/ad7280a.c     | 159 +++++++++++++++++-----------------
 drivers/staging/iio/adc/ad7606_core.c |  21 +++--
 drivers/staging/iio/adc/ad7606_par.c  |  10 +--
 drivers/staging/iio/adc/ad7606_spi.c  |   4 +-
 drivers/staging/iio/adc/ad7780.c      |  12 +--
 drivers/staging/iio/adc/ad7816.c      |  48 +++++-----
 drivers/staging/iio/adc/lpc32xx_adc.c |  14 +--
 drivers/staging/iio/adc/mxs-lradc.c   | 153 +++++++++++++++++---------------
 drivers/staging/iio/adc/spear_adc.c   |   4 +-
 10 files changed, 249 insertions(+), 223 deletions(-)
drivers/staging/iio/adc/ad7192.c +24 -23
index fe56fb6..5ae7a50 100644
@@ -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);
@@ -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);
@@ -383,8 +384,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 +394,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 +404,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 +530,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 +557,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 +572,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;
 }
drivers/staging/iio/adc/ad7280a.c +81 -78

293 lines not on this page · raw message

drivers/staging/iio/adc/ad7606_core.c +12 -9
index bf2c801..1e324fe 100644
@@ -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,8 @@ 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 +146,8 @@ 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 +168,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 +463,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 +532,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 +594,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);
drivers/staging/iio/adc/ad7606_par.c +5 -5
index 1d48ae3..fbe8237 100644
@@ -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);
drivers/staging/iio/adc/ad7606_spi.c +2 -2
index 7303983..9c62e94 100644
@@ -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);
drivers/staging/iio/adc/ad7780.c +7 -5
index 9f03fe3..722bb15 100644
@@ -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)
@@ -207,8 +207,10 @@ 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");
+		ret = devm_gpio_request_one(&spi->dev,
+					    pdata->gpio_pdrst,
+					    GPIOF_OUT_INIT_LOW,
+					    "AD7780 /PDRST");
 		if (ret) {
 			dev_err(&spi->dev, "failed to request GPIO PDRST\n");
 			goto error_disable_reg;
drivers/staging/iio/adc/ad7816.c +24 -24

126 lines not on this page · raw message

drivers/staging/iio/adc/lpc32xx_adc.c +7 -7
index bcf4ebb..d11c54b 100644
@@ -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;
drivers/staging/iio/adc/mxs-lradc.c +85 -68

360 lines not on this page · raw message

drivers/staging/iio/adc/spear_adc.c +2 -2
index c538237..712cae0 100644
@@ -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;
 	}
Signature · 1 line
2.1.4
Reviewed-by on v4 2/9
#4 lore raw

Re: [Outreachy kernel] [PATCH v4 2/9] staging: iio: adc: properly indent to match open paranthesis

Quoted 4 lines · Ioana Ciornei

Indent parameters and arguments passed to function calls to match open paranthesis

Quoted 1,227 lines

---
Changes in v2:
- nothing
Changes in v3:
- rework changes in order to avoid introducing new checkpatch warnings
Changes in v4:
- change the position of arguments in order to follow kernel coding style

 drivers/staging/iio/adc/ad7192.c      |  47 +++++-----
 drivers/staging/iio/adc/ad7280a.c     | 159 +++++++++++++++++-----------------
 drivers/staging/iio/adc/ad7606_core.c |  21 +++--
 drivers/staging/iio/adc/ad7606_par.c  |  10 +--
 drivers/staging/iio/adc/ad7606_spi.c  |   4 +-
 drivers/staging/iio/adc/ad7780.c      |  12 +--
 drivers/staging/iio/adc/ad7816.c      |  48 +++++-----
 drivers/staging/iio/adc/lpc32xx_adc.c |  14 +--
 drivers/staging/iio/adc/mxs-lradc.c   | 153 +++++++++++++++++---------------
 drivers/staging/iio/adc/spear_adc.c   |   4 +-
 10 files changed, 249 insertions(+), 223 deletions(-)
drivers/staging/iio/adc/ad7192.c +24 -23
index fe56fb6..5ae7a50 100644
@@ -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);
@@ -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);
@@ -383,8 +384,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 +394,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 +404,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 +530,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 +557,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 +572,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;
 }
drivers/staging/iio/adc/ad7280a.c +81 -78
index edbfba1..6db764e6 100644
@@ -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,8 @@ 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 +566,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++;
@@ -582,9 +582,10 @@ static int ad7280_attr_init(struct ad7280_state *st)
                        st->iio_attr[cnt].dev_attr.store =
                                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);
+                               kasprintf(GFP_KERNEL,
+                                         "in%d-in%d_balance_timer",
+                                         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 +596,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 +625,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 +699,41 @@ 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 +958,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);
drivers/staging/iio/adc/ad7606_core.c +12 -9
index bf2c801..1e324fe 100644
@@ -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,8 @@ 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 +146,8 @@ 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 +168,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 +463,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 +532,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 +594,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);
drivers/staging/iio/adc/ad7606_par.c +5 -5
index 1d48ae3..fbe8237 100644
@@ -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);
drivers/staging/iio/adc/ad7606_spi.c +2 -2
index 7303983..9c62e94 100644
@@ -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);
drivers/staging/iio/adc/ad7780.c +7 -5
index 9f03fe3..722bb15 100644
@@ -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)
@@ -207,8 +207,10 @@ 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");
+               ret = devm_gpio_request_one(&spi->dev,
+                                           pdata->gpio_pdrst,
+                                           GPIOF_OUT_INIT_LOW,
+                                           "AD7780 /PDRST");
                if (ret) {
                        dev_err(&spi->dev, "failed to request GPIO PDRST\n");
                        goto error_disable_reg;
drivers/staging/iio/adc/ad7816.c +24 -24
index 48b1c37..4e954d2 100644
@@ -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;
 }
drivers/staging/iio/adc/lpc32xx_adc.c +7 -7
index bcf4ebb..d11c54b 100644
@@ -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;
drivers/staging/iio/adc/mxs-lradc.c +85 -68
index d88d85b..f250aaf 100644
@@ -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);
 
@@ -471,12 +471,13 @@ static void mxs_lradc_setup_ts_channel(struct mxs_lradc *lradc, unsigned ch)
         * SoC's delay unit and start the conversion later
         * and automatically.
         */
-       mxs_lradc_reg_wrt(lradc,
+       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(2));
 }
 
 /*
@@ -486,7 +487,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;
 
@@ -511,12 +512,14 @@ static void mxs_lradc_setup_ts_pressure(struct mxs_lradc *lradc, unsigned ch1,
        mxs_lradc_reg_clear(lradc, LRADC_CH_VALUE_MASK, LRADC_CH(ch2));
 
        /* 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));
+       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));
 
        mxs_lradc_reg_clear(lradc, LRADC_CTRL1_LRADC_IRQ(ch2), LRADC_CTRL1);
 
@@ -526,7 +529,8 @@ static void mxs_lradc_setup_ts_pressure(struct mxs_lradc *lradc, unsigned ch1,
         * SoC's delay unit and start the conversion later
         * and automatically.
         */
-       mxs_lradc_reg_wrt(lradc,
+       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 |
@@ -534,7 +538,7 @@ static void mxs_lradc_setup_ts_pressure(struct mxs_lradc *lradc, unsigned ch1,
 }
 
 static unsigned mxs_lradc_read_raw_channel(struct mxs_lradc *lradc,
-                                                       unsigned channel)
+                                          unsigned channel)
 {
        u32 reg;
        unsigned num_samples, val;
@@ -550,7 +554,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 +611,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 +679,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 +688,18 @@ 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);
+       mxs_lradc_reg_clear(lradc,
+                           LRADC_CTRL1_TOUCH_DETECT_IRQ_EN,
+                           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 +726,14 @@ 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);
-       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_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));
 }
 
 /*
@@ -757,9 +765,11 @@ static void mxs_lradc_finish_touch_event(struct mxs_lradc *lradc, bool valid)
        lradc->cur_plate = LRADC_TOUCH;
        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);
+       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);
        mxs_lradc_reg_set(lradc, LRADC_CTRL1_TOUCH_DETECT_IRQ_EN, LRADC_CTRL1);
 }
 
@@ -771,25 +781,28 @@ 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);
+               lradc->ts_y_pos =
+                   mxs_lradc_read_raw_channel(lradc,
+                                              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);
+               lradc->ts_x_pos =
+                   mxs_lradc_read_raw_channel(lradc,
+                                              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);
+               lradc->ts_pressure =
+                   mxs_lradc_read_ts_pressure(lradc,
+                                              TOUCHSCREEN_VCHANNEL2,
+                                              TOUCHSCREEN_VCHANNEL1);
                mxs_lradc_complete_touch_event(lradc);
                return;
 
@@ -826,20 +839,22 @@ 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);
+               mxs_lradc_reg_set(lradc,
+                                 1 << LRADC_CTRL2_DIVIDE_BY_TWO_OFFSET,
+                                 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 +900,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 +995,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 +1014,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);
 
@@ -1274,7 +1289,8 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio)
        }
 
        if (lradc->soc == IMX28_LRADC)
-               mxs_lradc_reg_clear(lradc,
+               mxs_lradc_reg_clear(
+                       lradc,
                        lradc->buffer_vchans << LRADC_CTRL1_LRADC_IRQ_EN_OFFSET,
                        LRADC_CTRL1);
        mxs_lradc_reg_clear(lradc, lradc->buffer_vchans, LRADC_CTRL0);
@@ -1289,12 +1305,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,11 +1324,12 @@ 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,
+               mxs_lradc_reg_clear(
+                       lradc,
                        lradc->buffer_vchans << LRADC_CTRL1_LRADC_IRQ_EN_OFFSET,
                        LRADC_CTRL1);
 
@@ -1323,7 +1340,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 +1493,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 +1524,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 +1646,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 +1674,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;
 
drivers/staging/iio/adc/spear_adc.c +2 -3
index c538237..712cae0 100644
@@ -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

--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/13d205c0a7416cb9d3fe4aa19e2f22c5835a7663.1444845354.git.ciorneiioana%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#5 lore raw

PATCH v4 3/9 staging: iio: adc: remove explicit comparison to NULL

In reply to Ioana Ciornei

Use !condition instead off condition == NULL when comparing with NULL

---
Changes in v2:
- nothing
Changes in v3:
- nothing
Changes in v4:
- 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(-)
drivers/staging/iio/adc/ad7192.c +1 -1
index 5ae7a50..6adac61 100644
@@ -626,7 +626,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);
drivers/staging/iio/adc/ad7280a.c +4 -4
index 6db764e6..01156c7 100644
@@ -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++)
@@ -550,7 +550,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++)
@@ -687,7 +687,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);
@@ -842,7 +842,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);
drivers/staging/iio/adc/mxs-lradc.c +1 -1
index f250aaf..407d4a2 100644
@@ -1232,7 +1232,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;
Signature · 1 line
2.1.4
Reviewed-by on v4 3/9
#6 lore raw

Re: [Outreachy kernel] [PATCH v4 3/9] staging: iio: adc: remove explicit comparison to NULL

Quoted 3 lines · Ioana Ciornei

Use !condition instead off condition == NULL when comparing with NULL

Quoted 88 lines

---
Changes in v2:
- nothing
Changes in v3:
- nothing
Changes in v4:
- 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(-)
drivers/staging/iio/adc/ad7192.c +1 -1
index 5ae7a50..6adac61 100644
@@ -626,7 +626,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);
drivers/staging/iio/adc/ad7280a.c +4 -4
index 6db764e6..01156c7 100644
@@ -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++)
@@ -550,7 +550,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++)
@@ -687,7 +687,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);
@@ -842,7 +842,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);
drivers/staging/iio/adc/mxs-lradc.c +1 -2
index f250aaf..407d4a2 100644
@@ -1232,7 +1232,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

--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/8abc2bead1760b18d8e7bec4b6d91089fbeb95c2.1444845354.git.ciorneiioana%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#7 lore raw

PATCH v4 4/9 staging: iio: adc: remove space after cast

In reply to Ioana Ciornei

Remove the space after an explicit cast because there is no point in having it

---
Changes in v2:
- nothing
Changes in v3:
- nothing
Changes in v4:
- 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(-)
drivers/staging/iio/adc/ad7192.c +1 -1
index 6adac61..e7212c8 100644
@@ -424,7 +424,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;
drivers/staging/iio/adc/ad7280a.c +3 -3
index 01156c7..2737033 100644
@@ -604,7 +604,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;
@@ -640,7 +640,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 */
@@ -656,7 +656,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;
drivers/staging/iio/adc/ad7606_core.c +1 -1
index 1e324fe..5796ed2 100644
@@ -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;
drivers/staging/iio/adc/ad7606_par.c +2 -2
index fbe8237..3537a78 100644
@@ -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;
 }
Signature · 1 line
2.1.4
Reviewed-by on v4 4/9
#8 lore raw

Re: [Outreachy kernel] [PATCH v4 4/9] staging: iio: adc: remove space after cast

Quoted 4 lines · Ioana Ciornei

Remove the space after an explicit cast because there is no point in having it

Quoted 103 lines

---
Changes in v2:
- nothing
Changes in v3:
- nothing
Changes in v4:
- 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(-)
drivers/staging/iio/adc/ad7192.c +1 -1
index 6adac61..e7212c8 100644
@@ -424,7 +424,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;
drivers/staging/iio/adc/ad7280a.c +3 -3
index 01156c7..2737033 100644
@@ -604,7 +604,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;
@@ -640,7 +640,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 */
@@ -656,7 +656,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;
drivers/staging/iio/adc/ad7606_core.c +1 -1
index 1e324fe..5796ed2 100644
@@ -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;
drivers/staging/iio/adc/ad7606_par.c +2 -3
index fbe8237..3537a78 100644
@@ -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

--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/27e3072f96b82d21efe09e193daf6e45a6d9176b.1444845354.git.ciorneiioana%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#9 lore raw

PATCH v4 5/9 staging: iio: adc: add spaces around binary operators

In reply to Ioana Ciornei

Add spaces around binary operators like -, +, * etc in order to improve readability

---
Changes in v2:
- nothing
Changes in v3:
- nothing
Changes in v4:
- invert some changes in order to not break user space

 drivers/staging/iio/adc/ad7816.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/adc/ad7816.c +1 -1
index 4e954d2..6636087 100644
@@ -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;
 };
Signature · 1 line
2.1.4
Reviewed-by on v4 5/9
#10 lore raw

Re: [Outreachy kernel] [PATCH v4 5/9] staging: iio: adc: add spaces around binary operators

Quoted 4 lines · Ioana Ciornei

Add spaces around binary operators like -, +, * etc in order to improve readability

Quoted 34 lines

---
Changes in v2:
- nothing
Changes in v3:
- nothing
Changes in v4:
- invert some changes in order to not break user space

 drivers/staging/iio/adc/ad7816.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/adc/ad7816.c +1 -2
index 4e954d2..6636087 100644
@@ -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

--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/e1f448b6f32e6e7fd0329a4932f7163e8a6963a6.1444845354.git.ciorneiioana%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#11 lore raw

PATCH v4 6/9 staging: iio: adc: add blank line after declarations

In reply to Ioana Ciornei

Insert a blank line after declarations

---
Changes in v2:
- nothing
Changes in v3:
- nothing
Changes in v4:
- nothing

 drivers/staging/iio/adc/ad7606_par.c | 1 +
 drivers/staging/iio/adc/ad7606_spi.c | 1 +
 2 files changed, 2 insertions(+)
drivers/staging/iio/adc/ad7606_par.c +1 -0
index 3537a78..adc370e 100644
@@ -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
drivers/staging/iio/adc/ad7606_spi.c +1 -0
index 9c62e94..b88f882 100644
@@ -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
Signature · 1 line
2.1.4
Reviewed-by on v4 6/9
#12 lore raw

Re: [Outreachy kernel] [PATCH v4 6/9] staging: iio: adc: add blank line after declarations

Quoted 3 lines · Ioana Ciornei

Insert a blank line after declarations

Looks good to me.

For the next patches please try to explain *why* the change is needed. Here for example
you could have mentioned that this is needed to increase readability :).

Quoted 46 lines

---
Changes in v2:
- nothing
Changes in v3:
- nothing
Changes in v4:
- nothing

 drivers/staging/iio/adc/ad7606_par.c | 1 +
 drivers/staging/iio/adc/ad7606_spi.c | 1 +
 2 files changed, 2 insertions(+)
drivers/staging/iio/adc/ad7606_par.c +1 -0
index 3537a78..adc370e 100644
@@ -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
drivers/staging/iio/adc/ad7606_spi.c +1 -1
index 9c62e94..b88f882 100644
@@ -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

--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/8536cc1301474789695e23a74e16aa31d2d62e7e.1444845354.git.ciorneiioana%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#13 lore raw

PATCH v4 7/9 staging: iio: adc: remove multiple blank lines

In reply to Ioana Ciornei

Remove multiple blank lines since there is no practical reason to have it

---
Changes in v2:
- nothing
Changes in v3:
- nothing
Changes in v4:
- 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(-)
drivers/staging/iio/adc/ad7192.c +0 -1
index e7212c8..f3d793c 100644
@@ -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 */
drivers/staging/iio/adc/ad7280a.c +0 -1
index 2737033..d37e8a4 100644
@@ -769,7 +769,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,
drivers/staging/iio/adc/ad7780.c +0 -1
index 722bb15..618b41f 100644
@@ -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,
drivers/staging/iio/adc/ad7816.c +0 -3
index 6636087..b3dec706 100644
@@ -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)
Signature · 1 line
2.1.4
Reviewed-by on v4 7/9
#14 lore raw

Re: [Outreachy kernel] [PATCH v4 7/9] staging: iio: adc: remove multiple blank lines

Quoted 4 lines · Ioana Ciornei

Remove multiple blank lines since there is no practical reason to have it

Quoted 82 lines

---
Changes in v2:
- nothing
Changes in v3:
- nothing
Changes in v4:
- 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(-)
drivers/staging/iio/adc/ad7192.c +0 -1
index e7212c8..f3d793c 100644
@@ -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 */
drivers/staging/iio/adc/ad7280a.c +0 -1
index 2737033..d37e8a4 100644
@@ -769,7 +769,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,
drivers/staging/iio/adc/ad7780.c +0 -1
index 722bb15..618b41f 100644
@@ -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,
drivers/staging/iio/adc/ad7816.c +0 -4
index 6636087..b3dec706 100644
@@ -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

#15 lore raw

PATCH v4 8/9 staging: iio: adc: remove the use of CamelCase

In reply to Ioana Ciornei

Remove the use of CamelCase to follow the kernel naming conventions

---
Changes in v2:
- remove change added by mistake in v1
Changes in v3:
- nothing
Changes in v4:
- invert some changes in order to improve readability (some of them are just abbreviation: ACQ, AVG)

 drivers/staging/iio/adc/ad7192.c  | 10 +++++-----
 drivers/staging/iio/adc/ad7192.h  |  2 +-
 drivers/staging/iio/adc/ad7280a.c |  4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)
drivers/staging/iio/adc/ad7192.c +5 -5
index f3d793c..bb76096 100644
@@ -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;
drivers/staging/iio/adc/ad7192.h +1 -1
index a0a5b61..7433a43 100644
@@ -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;
drivers/staging/iio/adc/ad7280a.c +2 -2
index d37e8a4..45df714 100644
@@ -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
@@ -853,7 +853,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);
 
Signature · 1 line
2.1.4
Reviewed-by on v4 8/9
#16 lore raw

Re: [Outreachy kernel] [PATCH v4 8/9] staging: iio: adc: remove the use of CamelCase

Quoted 3 lines · Ioana Ciornei

Remove the use of CamelCase to follow the kernel naming conventions

Quoted 90 lines

---
Changes in v2:
- remove change added by mistake in v1
Changes in v3:
- nothing
Changes in v4:
- invert some changes in order to improve readability (some of them are just abbreviation: ACQ, AVG)

 drivers/staging/iio/adc/ad7192.c  | 10 +++++-----
 drivers/staging/iio/adc/ad7192.h  |  2 +-
 drivers/staging/iio/adc/ad7280a.c |  4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)
drivers/staging/iio/adc/ad7192.c +5 -5
index f3d793c..bb76096 100644
@@ -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;
drivers/staging/iio/adc/ad7192.h +1 -1
index a0a5b61..7433a43 100644
@@ -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;
drivers/staging/iio/adc/ad7280a.c +2 -3
index d37e8a4..45df714 100644
@@ -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
@@ -853,7 +853,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);
 
--

2.1.4

--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/d3276213a23191fd2c018c6d9b0bdbcc4710d5c2.1444845354.git.ciorneiioana%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#17 lore raw

PATCH v4 9/9 staging: iio: adc: properly indent block comments

In reply to Ioana Ciornei

Rework block comments in order to follow
kernel coding style

---
Changes in v2:
- nothing
Changes in v3:
- nothing
Changes in v4:
- move comment block above the macro def and not inline with it

 drivers/staging/iio/adc/ad7192.c | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)
drivers/staging/iio/adc/ad7192.c +25 -10
index bb76096..bb58fda 100644
@@ -35,10 +35,16 @@
 #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)) */
+/*
+ * Offset Register	     (RW, 16-bit
+ * (AD7792)/24-bit (AD7192))
+ */
+#define AD7192_REG_OFFSET	6
+/*
+ * Full-Scale Register
+ * (RW, 16-bit (AD7792)/24-bit (AD7192))
+ */
+#define AD7192_REG_FULLSALE	7
 
 /* Communications Register Bit Designations (AD7192_REG_COMM) */
 #define AD7192_COMM_WEN		BIT(7) /* Write Enable */
@@ -80,13 +86,22 @@
 #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 */
+/*
+ * External 4.92 MHz Clock connected
+ * from MCLK1 to MCLK2
+ */
+#define AD7192_CLK_EXT_MCLK1_2		0
 #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 */
+/*
+ * Internal 4.92 MHz Clock not
+ * available at the MCLK2 pin
+ */
+#define AD7192_CLK_INT			2
+/*
+ * Internal 4.92 MHz Clock available
+ * at the MCLK2 pin
+ */
+#define AD7192_CLK_INT_CO		3
 
 /* Configuration Register Bit Designations (AD7192_REG_CONF) */
 
Signature · 1 line
2.1.4
#18 lore raw

Re: [Outreachy kernel] [PATCH v4 9/9] staging: iio: adc: properly indent block comments

Quoted 59 lines · Ioana Ciornei

Rework block comments in order to follow
kernel coding style

---
Changes in v2:
- nothing
Changes in v3:
- nothing
Changes in v4:
- move comment block above the macro def and not inline with it

 drivers/staging/iio/adc/ad7192.c | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)
drivers/staging/iio/adc/ad7192.c +18 -10
index bb76096..bb58fda 100644
@@ -35,10 +35,16 @@
 #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)) */
+/*
+ * Offset Register          (RW, 16-bit
+ * (AD7792)/24-bit (AD7192))
+ */
+#define AD7192_REG_OFFSET      6
+/*
+ * Full-Scale Register
+ * (RW, 16-bit (AD7792)/24-bit (AD7192))
+ */
+#define AD7192_REG_FULLSALE    7
 
 /* Communications Register Bit Designations (AD7192_REG_COMM) */
 #define AD7192_COMM_WEN                BIT(7) /* Write Enable */
@@ -80,13 +86,22 @@
 #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 */
+/*
+ * External 4.92 MHz Clock connected
+ * from MCLK1 to MCLK2
+ */
+#define AD7192_CLK_EXT_MCLK1_2         0
 #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 */
+/*
+ * Internal 4.92 MHz Clock not
+ * available at the MCLK2 pin

drivers/staging/iio/adc/ad7192.c line 107

Quoted 10 lines
drivers/staging/iio/adc/ad7192.c +7 -0
+ */
+#define AD7192_CLK_INT                 2
+/*
+ * Internal 4.92 MHz Clock available
+ * at the MCLK2 pin
+ */
+#define AD7192_CLK_INT_CO              3
 
 /* Configuration Register Bit Designations (AD7192_REG_CONF) */
 

Comments here can be placed on a single line. Since this is the last patch in the series, it's safe to resend it alone after Greg applies all other patches from this patchseries.

#19 lore raw

Re: [Outreachy kernel] [PATCH v4 9/9] staging: iio: adc: properly indent block comments

Quoted 68 lines · Daniel Baluta
Quoted 67 lines · Ioana Ciornei

Rework block comments in order to follow
kernel coding style

---
Changes in v2:
- nothing
Changes in v3:
- nothing
Changes in v4:
- move comment block above the macro def and not inline with it

 drivers/staging/iio/adc/ad7192.c | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)
drivers/staging/iio/adc/ad7192.c +25 -10
index bb76096..bb58fda 100644
@@ -35,10 +35,16 @@
 #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)) */
+/*
+ * Offset Register          (RW, 16-bit
+ * (AD7792)/24-bit (AD7192))
+ */
+#define AD7192_REG_OFFSET      6
+/*
+ * Full-Scale Register
+ * (RW, 16-bit (AD7792)/24-bit (AD7192))
+ */
+#define AD7192_REG_FULLSALE    7
 
 /* Communications Register Bit Designations (AD7192_REG_COMM) */
 #define AD7192_COMM_WEN                BIT(7) /* Write Enable */
@@ -80,13 +86,22 @@
 #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 */
+/*
+ * External 4.92 MHz Clock connected
+ * from MCLK1 to MCLK2
+ */
+#define AD7192_CLK_EXT_MCLK1_2         0
 #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 */
+/*
+ * Internal 4.92 MHz Clock not
+ * available at the MCLK2 pin
+ */
+#define AD7192_CLK_INT                 2
+/*
+ * Internal 4.92 MHz Clock available
+ * at the MCLK2 pin
+ */
+#define AD7192_CLK_INT_CO              3
 
Quoted 6 lines

drivers/staging/iio/adc/ad7192.c line 107

Quoted 2 lines
drivers/staging/iio/adc/ad7192.c +0 -0
 /* Configuration Register Bit Designations (AD7192_REG_CONF) */
 

Comments here can be placed on a single line. Since this is the last patch in the series, it's safe to resend it alone after Greg applies all other patches from this patchseries.

Ok, will do.

Thanks,

Ioana