iio: core: fix a few code style issues
authorAlexander Vorwerk <alexander.vorwerk@stud.uni-goettingen.de>
Sat, 12 Mar 2022 18:03:43 +0000 (19:03 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 4 Apr 2022 08:11:23 +0000 (09:11 +0100)
* 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>
Link: https://lore.kernel.org/r/20220312180343.8935-1-alexander.vorwerk@stud.uni-goettingen.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-buffer.c
drivers/iio/industrialio-core.c

index b078eb2..0136997 100644 (file)
@@ -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;
index e1ed44d..2f48e9a 100644 (file)
@@ -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;