diff mbox series

[v2,8/8] iio: core: Improve indentation in a few places

Message ID 20230721170022.3461-9-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Headers show
Series iio: core: A few code cleanups and documentation fixes | expand

Commit Message

Andy Shevchenko July 21, 2023, 5 p.m. UTC
Improve an indentation in a few places to increase readability.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
---
 drivers/iio/industrialio-core.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

Comments

Jonathan Cameron July 23, 2023, 9:24 a.m. UTC | #1
On Fri, 21 Jul 2023 20:00:22 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Improve an indentation in a few places to increase readability.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Applied to the togreg branch of iio.git and pushed out as testing
for 0-day to not notice any change (hopefully ;)

Jonathan

> ---
>  drivers/iio/industrialio-core.c | 23 ++++++++++-------------
>  1 file changed, 10 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index 5c9c68d69fc6..e1293fdbc0ef 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -206,9 +206,9 @@ bool iio_buffer_enabled(struct iio_dev *indio_dev)
>  {
>  	struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev);
>  
> -	return iio_dev_opaque->currentmode
> -		& (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE |
> -		   INDIO_BUFFER_SOFTWARE);
> +	return iio_dev_opaque->currentmode &
> +	       (INDIO_BUFFER_HARDWARE | INDIO_BUFFER_SOFTWARE |
> +		INDIO_BUFFER_TRIGGERED);
>  }
>  EXPORT_SYMBOL_GPL(iio_buffer_enabled);
>  
> @@ -388,8 +388,8 @@ static ssize_t iio_debugfs_read_reg(struct file *file, char __user *userbuf,
>  	}
>  
>  	iio_dev_opaque->read_buf_len = snprintf(iio_dev_opaque->read_buf,
> -					      sizeof(iio_dev_opaque->read_buf),
> -					      "0x%X\n", val);
> +						sizeof(iio_dev_opaque->read_buf),
> +						"0x%X\n", val);
>  
>  	return simple_read_from_buffer(userbuf, count, ppos,
>  				       iio_dev_opaque->read_buf,
> @@ -492,8 +492,7 @@ static ssize_t iio_read_channel_ext_info(struct device *dev,
>  
>  static ssize_t iio_write_channel_ext_info(struct device *dev,
>  				     struct device_attribute *attr,
> -				     const char *buf,
> -					 size_t len)
> +				     const char *buf, size_t len)
>  {
>  	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
>  	struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
> @@ -585,9 +584,9 @@ static int iio_setup_mount_idmatrix(const struct device *dev,
>  ssize_t iio_show_mount_matrix(struct iio_dev *indio_dev, uintptr_t priv,
>  			      const struct iio_chan_spec *chan, char *buf)
>  {
> -	const struct iio_mount_matrix *mtx = ((iio_get_mount_matrix_t *)
> -					      priv)(indio_dev, chan);
> +	const struct iio_mount_matrix *mtx;
>  
> +	mtx = ((iio_get_mount_matrix_t *)priv)(indio_dev, chan);
>  	if (IS_ERR(mtx))
>  		return PTR_ERR(mtx);
>  
> @@ -1025,14 +1024,12 @@ int __iio_device_attr_init(struct device_attribute *dev_attr,
>  	if (chan->modified && (shared_by == IIO_SEPARATE)) {
>  		if (chan->extend_name)
>  			full_postfix = kasprintf(GFP_KERNEL, "%s_%s_%s",
> -						 iio_modifier_names[chan
> -								    ->channel2],  
> +						 iio_modifier_names[chan->channel2],
>  						 chan->extend_name,
>  						 postfix);
>  		else
>  			full_postfix = kasprintf(GFP_KERNEL, "%s_%s",
> -						 iio_modifier_names[chan
> -								    ->channel2],  
> +						 iio_modifier_names[chan->channel2],
>  						 postfix);
>  	} else {
>  		if (chan->extend_name == NULL || shared_by != IIO_SEPARATE)
diff mbox series

Patch

diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 5c9c68d69fc6..e1293fdbc0ef 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -206,9 +206,9 @@  bool iio_buffer_enabled(struct iio_dev *indio_dev)
 {
 	struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev);
 
-	return iio_dev_opaque->currentmode
-		& (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE |
-		   INDIO_BUFFER_SOFTWARE);
+	return iio_dev_opaque->currentmode &
+	       (INDIO_BUFFER_HARDWARE | INDIO_BUFFER_SOFTWARE |
+		INDIO_BUFFER_TRIGGERED);
 }
 EXPORT_SYMBOL_GPL(iio_buffer_enabled);
 
@@ -388,8 +388,8 @@  static ssize_t iio_debugfs_read_reg(struct file *file, char __user *userbuf,
 	}
 
 	iio_dev_opaque->read_buf_len = snprintf(iio_dev_opaque->read_buf,
-					      sizeof(iio_dev_opaque->read_buf),
-					      "0x%X\n", val);
+						sizeof(iio_dev_opaque->read_buf),
+						"0x%X\n", val);
 
 	return simple_read_from_buffer(userbuf, count, ppos,
 				       iio_dev_opaque->read_buf,
@@ -492,8 +492,7 @@  static ssize_t iio_read_channel_ext_info(struct device *dev,
 
 static ssize_t iio_write_channel_ext_info(struct device *dev,
 				     struct device_attribute *attr,
-				     const char *buf,
-					 size_t len)
+				     const char *buf, size_t len)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
@@ -585,9 +584,9 @@  static int iio_setup_mount_idmatrix(const struct device *dev,
 ssize_t iio_show_mount_matrix(struct iio_dev *indio_dev, uintptr_t priv,
 			      const struct iio_chan_spec *chan, char *buf)
 {
-	const struct iio_mount_matrix *mtx = ((iio_get_mount_matrix_t *)
-					      priv)(indio_dev, chan);
+	const struct iio_mount_matrix *mtx;
 
+	mtx = ((iio_get_mount_matrix_t *)priv)(indio_dev, chan);
 	if (IS_ERR(mtx))
 		return PTR_ERR(mtx);
 
@@ -1025,14 +1024,12 @@  int __iio_device_attr_init(struct device_attribute *dev_attr,
 	if (chan->modified && (shared_by == IIO_SEPARATE)) {
 		if (chan->extend_name)
 			full_postfix = kasprintf(GFP_KERNEL, "%s_%s_%s",
-						 iio_modifier_names[chan
-								    ->channel2],
+						 iio_modifier_names[chan->channel2],
 						 chan->extend_name,
 						 postfix);
 		else
 			full_postfix = kasprintf(GFP_KERNEL, "%s_%s",
-						 iio_modifier_names[chan
-								    ->channel2],
+						 iio_modifier_names[chan->channel2],
 						 postfix);
 	} else {
 		if (chan->extend_name == NULL || shared_by != IIO_SEPARATE)