linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: iio: fix a few code style issues
@ 2022-03-12 18:03 Alexander Vorwerk
  2022-03-20 13:27 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Vorwerk @ 2022-03-12 18:03 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, linux-kernel, Alexander Vorwerk

* Fix indent in else statement
* Remove unnecessary 'else' after 'break'
* Remove space in '* attr'

Signed-off-by: Alexander Vorwerk <alexander.vorwerk@stud.uni-goettingen.de>
---
 drivers/iio/industrialio-buffer.c | 4 ++--
 drivers/iio/industrialio-core.c   | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index 208b5193c621..15c5405853d7 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -915,7 +915,7 @@ static int iio_verify_update(struct iio_dev *indio_dev,
 		if (scan_mask == NULL)
 			return -EINVAL;
 	} else {
-	    scan_mask = compound_mask;
+		scan_mask = compound_mask;
 	}
 
 	config->scan_bytes = iio_compute_scan_bytes(indio_dev,
@@ -1649,7 +1649,7 @@ static int __iio_buffer_alloc_sysfs_and_mask(struct iio_buffer *buffer,
 	}
 
 	attrn = buffer_attrcount + scan_el_attrcount + ARRAY_SIZE(iio_buffer_attrs);
-	attr = kcalloc(attrn + 1, sizeof(* attr), GFP_KERNEL);
+	attr = kcalloc(attrn + 1, sizeof(*attr), GFP_KERNEL);
 	if (!attr) {
 		ret = -ENOMEM;
 		goto error_free_scan_mask;
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 409c278a4c2c..346c8fbf18a4 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -892,8 +892,7 @@ static int __iio_str_to_fixpoint(const char *str, int fract_mult,
 		} else if (*str == '\n') {
 			if (*(str + 1) == '\0')
 				break;
-			else
-				return -EINVAL;
+			return -EINVAL;
 		} else if (!strncmp(str, " dB", sizeof(" dB") - 1) && scale_db) {
 			/* Ignore the dB suffix */
 			str += sizeof(" dB") - 1;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers: iio: fix a few code style issues
  2022-03-12 18:03 [PATCH] drivers: iio: fix a few code style issues Alexander Vorwerk
@ 2022-03-20 13:27 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2022-03-20 13:27 UTC (permalink / raw)
  To: Alexander Vorwerk; +Cc: linux-iio, linux-kernel

On Sat, 12 Mar 2022 19:03:43 +0100
Alexander Vorwerk <alexander.vorwerk@stud.uni-goettingen.de> wrote:

> * Fix indent in else statement
> * Remove unnecessary 'else' after 'break'
> * Remove space in '* attr'
> 
> Signed-off-by: Alexander Vorwerk <alexander.vorwerk@stud.uni-goettingen.de>

Applied to the togreg branch of iio.git and pushed out as testing to let the
autobuilders see if they can find any problems.

Note that I'll be rebasing the tree after rc1.

Thanks,

Jonathan

> ---
>  drivers/iio/industrialio-buffer.c | 4 ++--
>  drivers/iio/industrialio-core.c   | 3 +--
>  2 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
> index 208b5193c621..15c5405853d7 100644
> --- a/drivers/iio/industrialio-buffer.c
> +++ b/drivers/iio/industrialio-buffer.c
> @@ -915,7 +915,7 @@ static int iio_verify_update(struct iio_dev *indio_dev,
>  		if (scan_mask == NULL)
>  			return -EINVAL;
>  	} else {
> -	    scan_mask = compound_mask;
> +		scan_mask = compound_mask;
>  	}
>  
>  	config->scan_bytes = iio_compute_scan_bytes(indio_dev,
> @@ -1649,7 +1649,7 @@ static int __iio_buffer_alloc_sysfs_and_mask(struct iio_buffer *buffer,
>  	}
>  
>  	attrn = buffer_attrcount + scan_el_attrcount + ARRAY_SIZE(iio_buffer_attrs);
> -	attr = kcalloc(attrn + 1, sizeof(* attr), GFP_KERNEL);
> +	attr = kcalloc(attrn + 1, sizeof(*attr), GFP_KERNEL);
>  	if (!attr) {
>  		ret = -ENOMEM;
>  		goto error_free_scan_mask;
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index 409c278a4c2c..346c8fbf18a4 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -892,8 +892,7 @@ static int __iio_str_to_fixpoint(const char *str, int fract_mult,
>  		} else if (*str == '\n') {
>  			if (*(str + 1) == '\0')
>  				break;
> -			else
> -				return -EINVAL;
> +			return -EINVAL;
>  		} else if (!strncmp(str, " dB", sizeof(" dB") - 1) && scale_db) {
>  			/* Ignore the dB suffix */
>  			str += sizeof(" dB") - 1;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-20 13:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-12 18:03 [PATCH] drivers: iio: fix a few code style issues Alexander Vorwerk
2022-03-20 13:27 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).