diff options
author | Ioana Ciornei <ciorneiioana@gmail.com> | 2015-10-28 19:01:48 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-28 19:53:42 -0400 |
commit | 1abe0c9a72dbf9ca060ecce86a8beedf66436024 (patch) | |
tree | ad167f2263ea1008130eef02686e94cf0e6375bd | |
parent | 0bc852413be32a07d12364ee24c772b335fa6f86 (diff) |
staging: iio: accel: add spaces aroung binary operators
This patch adds spaces around binary operators such as '*',
'/', '+' in order to improve readability.
Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/iio/accel/lis3l02dq_core.c | 4 | ||||
-rw-r--r-- | drivers/staging/iio/accel/lis3l02dq_ring.c | 24 | ||||
-rw-r--r-- | drivers/staging/iio/accel/sca3000_core.c | 28 | ||||
-rw-r--r-- | drivers/staging/iio/accel/sca3000_ring.c | 4 |
4 files changed, 30 insertions, 30 deletions
diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c index ebcab56c81b9..db28b55a72c4 100644 --- a/drivers/staging/iio/accel/lis3l02dq_core.c +++ b/drivers/staging/iio/accel/lis3l02dq_core.c | |||
@@ -565,7 +565,7 @@ static int lis3l02dq_read_event_config(struct iio_dev *indio_dev, | |||
565 | { | 565 | { |
566 | u8 val; | 566 | u8 val; |
567 | int ret; | 567 | int ret; |
568 | u8 mask = (1 << (chan->channel2*2 + (dir == IIO_EV_DIR_RISING))); | 568 | u8 mask = (1 << (chan->channel2 * 2 + (dir == IIO_EV_DIR_RISING))); |
569 | 569 | ||
570 | ret = lis3l02dq_spi_read_reg_8(indio_dev, | 570 | ret = lis3l02dq_spi_read_reg_8(indio_dev, |
571 | LIS3L02DQ_REG_WAKE_UP_CFG_ADDR, | 571 | LIS3L02DQ_REG_WAKE_UP_CFG_ADDR, |
@@ -620,7 +620,7 @@ static int lis3l02dq_write_event_config(struct iio_dev *indio_dev, | |||
620 | u8 val, control; | 620 | u8 val, control; |
621 | u8 currentlyset; | 621 | u8 currentlyset; |
622 | bool changed = false; | 622 | bool changed = false; |
623 | u8 mask = (1 << (chan->channel2*2 + (dir == IIO_EV_DIR_RISING))); | 623 | u8 mask = (1 << (chan->channel2 * 2 + (dir == IIO_EV_DIR_RISING))); |
624 | 624 | ||
625 | mutex_lock(&indio_dev->mlock); | 625 | mutex_lock(&indio_dev->mlock); |
626 | /* read current control */ | 626 | /* read current control */ |
diff --git a/drivers/staging/iio/accel/lis3l02dq_ring.c b/drivers/staging/iio/accel/lis3l02dq_ring.c index 1a0651cb2691..50c162e0c31f 100644 --- a/drivers/staging/iio/accel/lis3l02dq_ring.c +++ b/drivers/staging/iio/accel/lis3l02dq_ring.c | |||
@@ -69,25 +69,25 @@ static int lis3l02dq_read_all(struct iio_dev *indio_dev, u8 *rx_array) | |||
69 | 69 | ||
70 | mutex_lock(&st->buf_lock); | 70 | mutex_lock(&st->buf_lock); |
71 | 71 | ||
72 | for (i = 0; i < ARRAY_SIZE(read_all_tx_array)/4; i++) | 72 | for (i = 0; i < ARRAY_SIZE(read_all_tx_array) / 4; i++) |
73 | if (test_bit(i, indio_dev->active_scan_mask)) { | 73 | if (test_bit(i, indio_dev->active_scan_mask)) { |
74 | /* lower byte */ | 74 | /* lower byte */ |
75 | xfers[j].tx_buf = st->tx + 2*j; | 75 | xfers[j].tx_buf = st->tx + (2 * j); |
76 | st->tx[2*j] = read_all_tx_array[i*4]; | 76 | st->tx[2 * j] = read_all_tx_array[i * 4]; |
77 | st->tx[2*j + 1] = 0; | 77 | st->tx[2 * j + 1] = 0; |
78 | if (rx_array) | 78 | if (rx_array) |
79 | xfers[j].rx_buf = rx_array + j*2; | 79 | xfers[j].rx_buf = rx_array + (j * 2); |
80 | xfers[j].bits_per_word = 8; | 80 | xfers[j].bits_per_word = 8; |
81 | xfers[j].len = 2; | 81 | xfers[j].len = 2; |
82 | xfers[j].cs_change = 1; | 82 | xfers[j].cs_change = 1; |
83 | j++; | 83 | j++; |
84 | 84 | ||
85 | /* upper byte */ | 85 | /* upper byte */ |
86 | xfers[j].tx_buf = st->tx + 2*j; | 86 | xfers[j].tx_buf = st->tx + (2 * j); |
87 | st->tx[2*j] = read_all_tx_array[i*4 + 2]; | 87 | st->tx[2 * j] = read_all_tx_array[i * 4 + 2]; |
88 | st->tx[2*j + 1] = 0; | 88 | st->tx[2 * j + 1] = 0; |
89 | if (rx_array) | 89 | if (rx_array) |
90 | xfers[j].rx_buf = rx_array + j*2; | 90 | xfers[j].rx_buf = rx_array + (j * 2); |
91 | xfers[j].bits_per_word = 8; | 91 | xfers[j].bits_per_word = 8; |
92 | xfers[j].len = 2; | 92 | xfers[j].len = 2; |
93 | xfers[j].cs_change = 1; | 93 | xfers[j].cs_change = 1; |
@@ -127,11 +127,11 @@ static int lis3l02dq_get_buffer_element(struct iio_dev *indio_dev, | |||
127 | return ret; | 127 | return ret; |
128 | } | 128 | } |
129 | for (i = 0; i < scan_count; i++) | 129 | for (i = 0; i < scan_count; i++) |
130 | data[i] = combine_8_to_16(rx_array[i*4+1], | 130 | data[i] = combine_8_to_16(rx_array[i * 4 + 1], |
131 | rx_array[i*4+3]); | 131 | rx_array[i * 4 + 3]); |
132 | kfree(rx_array); | 132 | kfree(rx_array); |
133 | 133 | ||
134 | return i*sizeof(data[0]); | 134 | return i * sizeof(data[0]); |
135 | } | 135 | } |
136 | 136 | ||
137 | static irqreturn_t lis3l02dq_trigger_handler(int irq, void *p) | 137 | static irqreturn_t lis3l02dq_trigger_handler(int irq, void *p) |
diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c index b614f272b5f4..311c8a125ee3 100644 --- a/drivers/staging/iio/accel/sca3000_core.c +++ b/drivers/staging/iio/accel/sca3000_core.c | |||
@@ -471,8 +471,8 @@ static int sca3000_read_raw(struct iio_dev *indio_dev, | |||
471 | return ret; | 471 | return ret; |
472 | } | 472 | } |
473 | *val = (be16_to_cpup((__be16 *)st->rx) >> 3) & 0x1FFF; | 473 | *val = (be16_to_cpup((__be16 *)st->rx) >> 3) & 0x1FFF; |
474 | *val = ((*val) << (sizeof(*val)*8 - 13)) >> | 474 | *val = ((*val) << (sizeof(*val) * 8 - 13)) >> |
475 | (sizeof(*val)*8 - 13); | 475 | (sizeof(*val) * 8 - 13); |
476 | } else { | 476 | } else { |
477 | /* get the temperature when available */ | 477 | /* get the temperature when available */ |
478 | ret = sca3000_read_data_short(st, | 478 | ret = sca3000_read_data_short(st, |
@@ -529,20 +529,20 @@ static ssize_t sca3000_read_av_freq(struct device *dev, | |||
529 | case SCA3000_MEAS_MODE_NORMAL: | 529 | case SCA3000_MEAS_MODE_NORMAL: |
530 | len += sprintf(buf + len, "%d %d %d\n", | 530 | len += sprintf(buf + len, "%d %d %d\n", |
531 | st->info->measurement_mode_freq, | 531 | st->info->measurement_mode_freq, |
532 | st->info->measurement_mode_freq/2, | 532 | st->info->measurement_mode_freq / 2, |
533 | st->info->measurement_mode_freq/4); | 533 | st->info->measurement_mode_freq / 4); |
534 | break; | 534 | break; |
535 | case SCA3000_MEAS_MODE_OP_1: | 535 | case SCA3000_MEAS_MODE_OP_1: |
536 | len += sprintf(buf + len, "%d %d %d\n", | 536 | len += sprintf(buf + len, "%d %d %d\n", |
537 | st->info->option_mode_1_freq, | 537 | st->info->option_mode_1_freq, |
538 | st->info->option_mode_1_freq/2, | 538 | st->info->option_mode_1_freq / 2, |
539 | st->info->option_mode_1_freq/4); | 539 | st->info->option_mode_1_freq / 4); |
540 | break; | 540 | break; |
541 | case SCA3000_MEAS_MODE_OP_2: | 541 | case SCA3000_MEAS_MODE_OP_2: |
542 | len += sprintf(buf + len, "%d %d %d\n", | 542 | len += sprintf(buf + len, "%d %d %d\n", |
543 | st->info->option_mode_2_freq, | 543 | st->info->option_mode_2_freq, |
544 | st->info->option_mode_2_freq/2, | 544 | st->info->option_mode_2_freq / 2, |
545 | st->info->option_mode_2_freq/4); | 545 | st->info->option_mode_2_freq / 4); |
546 | break; | 546 | break; |
547 | } | 547 | } |
548 | return len; | 548 | return len; |
@@ -605,10 +605,10 @@ static ssize_t sca3000_read_frequency(struct device *dev, | |||
605 | len = sprintf(buf, "%d\n", base_freq); | 605 | len = sprintf(buf, "%d\n", base_freq); |
606 | break; | 606 | break; |
607 | case 0x01: | 607 | case 0x01: |
608 | len = sprintf(buf, "%d\n", base_freq/2); | 608 | len = sprintf(buf, "%d\n", base_freq / 2); |
609 | break; | 609 | break; |
610 | case 0x02: | 610 | case 0x02: |
611 | len = sprintf(buf, "%d\n", base_freq/4); | 611 | len = sprintf(buf, "%d\n", base_freq / 4); |
612 | break; | 612 | break; |
613 | } | 613 | } |
614 | 614 | ||
@@ -650,9 +650,9 @@ static ssize_t sca3000_set_frequency(struct device *dev, | |||
650 | /* clear the bits */ | 650 | /* clear the bits */ |
651 | ctrlval &= ~0x03; | 651 | ctrlval &= ~0x03; |
652 | 652 | ||
653 | if (val == base_freq/2) { | 653 | if (val == base_freq / 2) { |
654 | ctrlval |= SCA3000_OUT_CTRL_BUF_DIV_2; | 654 | ctrlval |= SCA3000_OUT_CTRL_BUF_DIV_2; |
655 | } else if (val == base_freq/4) { | 655 | } else if (val == base_freq / 4) { |
656 | ctrlval |= SCA3000_OUT_CTRL_BUF_DIV_4; | 656 | ctrlval |= SCA3000_OUT_CTRL_BUF_DIV_4; |
657 | } else if (val != base_freq) { | 657 | } else if (val != base_freq) { |
658 | ret = -EINVAL; | 658 | ret = -EINVAL; |
@@ -997,14 +997,14 @@ exit_point: | |||
997 | 997 | ||
998 | /* Free fall detector related event attribute */ | 998 | /* Free fall detector related event attribute */ |
999 | static IIO_DEVICE_ATTR_NAMED(accel_xayaz_mag_falling_en, | 999 | static IIO_DEVICE_ATTR_NAMED(accel_xayaz_mag_falling_en, |
1000 | in_accel_x&y&z_mag_falling_en, | 1000 | in_accel_x & y & z_mag_falling_en, |
1001 | S_IRUGO | S_IWUSR, | 1001 | S_IRUGO | S_IWUSR, |
1002 | sca3000_query_free_fall_mode, | 1002 | sca3000_query_free_fall_mode, |
1003 | sca3000_set_free_fall_mode, | 1003 | sca3000_set_free_fall_mode, |
1004 | 0); | 1004 | 0); |
1005 | 1005 | ||
1006 | static IIO_CONST_ATTR_NAMED(accel_xayaz_mag_falling_period, | 1006 | static IIO_CONST_ATTR_NAMED(accel_xayaz_mag_falling_period, |
1007 | in_accel_x&y&z_mag_falling_period, | 1007 | in_accel_x & y & z_mag_falling_period, |
1008 | "0.226"); | 1008 | "0.226"); |
1009 | 1009 | ||
1010 | static struct attribute *sca3000_event_attributes[] = { | 1010 | static struct attribute *sca3000_event_attributes[] = { |
diff --git a/drivers/staging/iio/accel/sca3000_ring.c b/drivers/staging/iio/accel/sca3000_ring.c index ac35d031f81b..a029af0cb0ec 100644 --- a/drivers/staging/iio/accel/sca3000_ring.c +++ b/drivers/staging/iio/accel/sca3000_ring.c | |||
@@ -106,7 +106,7 @@ static int sca3000_read_first_n_hw_rb(struct iio_buffer *r, | |||
106 | * i.e. number of time points * number of channels. | 106 | * i.e. number of time points * number of channels. |
107 | */ | 107 | */ |
108 | if (count > num_available * bytes_per_sample) | 108 | if (count > num_available * bytes_per_sample) |
109 | num_read = num_available*bytes_per_sample; | 109 | num_read = num_available * bytes_per_sample; |
110 | else | 110 | else |
111 | num_read = count; | 111 | num_read = count; |
112 | 112 | ||
@@ -208,7 +208,7 @@ static ssize_t sca3000_show_buffer_scale(struct device *dev, | |||
208 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); | 208 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); |
209 | struct sca3000_state *st = iio_priv(indio_dev); | 209 | struct sca3000_state *st = iio_priv(indio_dev); |
210 | 210 | ||
211 | return sprintf(buf, "0.%06d\n", 4*st->info->scale); | 211 | return sprintf(buf, "0.%06d\n", 4 * st->info->scale); |
212 | } | 212 | } |
213 | 213 | ||
214 | static IIO_DEVICE_ATTR(in_accel_scale, | 214 | static IIO_DEVICE_ATTR(in_accel_scale, |