Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: accel: mma9553: fix alignment issues

Fix code alignment and wrap parameters.
Fix issues reported by checkpatch.pl --strict.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Suggested-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Irina Tirdea and committed by
Jonathan Cameron
b37c1990 c0d901cc

+43 -47
+4 -4
drivers/iio/accel/mma9551_core.c
··· 297 297 * Returns: 0 on success, negative value on failure. 298 298 */ 299 299 int mma9551_read_config_word(struct i2c_client *client, u8 app_id, 300 - u16 reg, u16 *val) 300 + u16 reg, u16 *val) 301 301 { 302 302 int ret; 303 303 __be16 v; ··· 328 328 * Returns: 0 on success, negative value on failure. 329 329 */ 330 330 int mma9551_write_config_word(struct i2c_client *client, u8 app_id, 331 - u16 reg, u16 val) 331 + u16 reg, u16 val) 332 332 { 333 333 __be16 v = cpu_to_be16(val); 334 334 335 335 return mma9551_transfer(client, app_id, MMA9551_CMD_WRITE_CONFIG, reg, 336 - (u8 *) &v, 2, NULL, 0); 336 + (u8 *)&v, 2, NULL, 0); 337 337 } 338 338 EXPORT_SYMBOL(mma9551_write_config_word); 339 339 ··· 385 385 * Returns: 0 on success, negative value on failure. 386 386 */ 387 387 int mma9551_read_config_words(struct i2c_client *client, u8 app_id, 388 - u16 reg, u8 len, u16 *buf) 388 + u16 reg, u8 len, u16 *buf) 389 389 { 390 390 int ret, i; 391 391 __be16 be_buf[MMA9551_MAX_MAILBOX_DATA_REGS / 2];
+3 -3
drivers/iio/accel/mma9551_core.h
··· 53 53 int mma9551_read_status_byte(struct i2c_client *client, u8 app_id, 54 54 u16 reg, u8 *val); 55 55 int mma9551_read_config_word(struct i2c_client *client, u8 app_id, 56 - u16 reg, u16 *val); 56 + u16 reg, u16 *val); 57 57 int mma9551_write_config_word(struct i2c_client *client, u8 app_id, 58 - u16 reg, u16 val); 58 + u16 reg, u16 val); 59 59 int mma9551_read_status_word(struct i2c_client *client, u8 app_id, 60 60 u16 reg, u16 *val); 61 61 int mma9551_read_config_words(struct i2c_client *client, u8 app_id, 62 - u16 reg, u8 len, u16 *buf); 62 + u16 reg, u8 len, u16 *buf); 63 63 int mma9551_read_status_words(struct i2c_client *client, u8 app_id, 64 64 u16 reg, u8 len, u16 *buf); 65 65 int mma9551_write_config_words(struct i2c_client *client, u8 app_id,
+36 -40
drivers/iio/accel/mma9553.c
··· 343 343 struct mma9553_event *ev_step_detect; 344 344 bool activity_enabled; 345 345 346 - activity_enabled = 347 - mma9553_is_any_event_enabled(data, true, IIO_ACTIVITY); 348 - ev_step_detect = 349 - mma9553_get_event(data, IIO_STEPS, IIO_NO_MOD, IIO_EV_DIR_NONE); 346 + activity_enabled = mma9553_is_any_event_enabled(data, true, 347 + IIO_ACTIVITY); 348 + ev_step_detect = mma9553_get_event(data, IIO_STEPS, IIO_NO_MOD, 349 + IIO_EV_DIR_NONE); 350 350 351 351 /* 352 352 * If both step detector and activity are enabled, use the MRGFL bit. ··· 372 372 return ret; 373 373 } 374 374 375 - ret = mma9551_gpio_config(data->client, 376 - MMA9553_DEFAULT_GPIO_PIN, 377 - appid, bitnum, MMA9553_DEFAULT_GPIO_POLARITY); 375 + ret = mma9551_gpio_config(data->client, MMA9553_DEFAULT_GPIO_PIN, appid, 376 + bitnum, MMA9553_DEFAULT_GPIO_POLARITY); 378 377 if (ret < 0) 379 378 return ret; 380 379 data->gpio_bitnum = bitnum; ··· 394 395 * a device identification command to differentiate the MMA9553L 395 396 * from the MMA9550L. 396 397 */ 397 - ret = 398 - mma9551_read_config_words(data->client, MMA9551_APPID_PEDOMETER, 399 - MMA9553_REG_CONF_SLEEPMIN, 400 - sizeof(data->conf) / sizeof(u16), 401 - (u16 *)&data->conf); 398 + ret = mma9551_read_config_words(data->client, MMA9551_APPID_PEDOMETER, 399 + MMA9553_REG_CONF_SLEEPMIN, 400 + sizeof(data->conf) / sizeof(u16), 401 + (u16 *)&data->conf); 402 402 if (ret < 0) { 403 403 dev_err(&data->client->dev, 404 404 "failed to read configuration registers\n"); 405 405 return ret; 406 406 } 407 - 408 407 409 408 /* Reset GPIO */ 410 409 data->gpio_bitnum = MMA9553_MAX_BITNUM; ··· 418 421 data->conf.sleepmin = MMA9553_DEFAULT_SLEEPMIN; 419 422 data->conf.sleepmax = MMA9553_DEFAULT_SLEEPMAX; 420 423 data->conf.sleepthd = MMA9553_DEFAULT_SLEEPTHD; 421 - data->conf.config = 422 - mma9553_set_bits(data->conf.config, 1, MMA9553_MASK_CONF_CONFIG); 424 + data->conf.config = mma9553_set_bits(data->conf.config, 1, 425 + MMA9553_MASK_CONF_CONFIG); 423 426 /* 424 427 * Clear the activity debounce counter when the activity level changes, 425 428 * so that the confidence level applies for any activity level. 426 429 */ 427 430 data->conf.config = mma9553_set_bits(data->conf.config, 1, 428 431 MMA9553_MASK_CONF_ACT_DBCNTM); 429 - ret = 430 - mma9551_write_config_words(data->client, MMA9551_APPID_PEDOMETER, 431 - MMA9553_REG_CONF_SLEEPMIN, 432 - sizeof(data->conf) / sizeof(u16), 433 - (u16 *)&data->conf); 432 + ret = mma9551_write_config_words(data->client, MMA9551_APPID_PEDOMETER, 433 + MMA9553_REG_CONF_SLEEPMIN, 434 + sizeof(data->conf) / sizeof(u16), 435 + (u16 *)&data->conf); 434 436 if (ret < 0) { 435 437 dev_err(&data->client->dev, 436 438 "failed to write configuration registers\n"); ··· 566 570 return IIO_VAL_INT; 567 571 case IIO_CHAN_INFO_CALIBHEIGHT: 568 572 tmp = mma9553_get_bits(data->conf.height_weight, 569 - MMA9553_MASK_CONF_HEIGHT); 573 + MMA9553_MASK_CONF_HEIGHT); 570 574 *val = tmp / 100; /* cm to m */ 571 575 *val2 = (tmp % 100) * 10000; 572 576 return IIO_VAL_INT_PLUS_MICRO; ··· 718 722 enum iio_event_type type, 719 723 enum iio_event_direction dir) 720 724 { 721 - 722 725 struct mma9553_data *data = iio_priv(indio_dev); 723 726 struct mma9553_event *event; 724 727 ··· 1024 1029 return IRQ_HANDLED; 1025 1030 } 1026 1031 1027 - ev_prev_activity = 1028 - mma9553_get_event(data, IIO_ACTIVITY, 1029 - mma9553_activity_to_mod(data->activity), 1030 - IIO_EV_DIR_FALLING); 1031 - ev_activity = 1032 - mma9553_get_event(data, IIO_ACTIVITY, 1033 - mma9553_activity_to_mod(activity), 1034 - IIO_EV_DIR_RISING); 1035 - ev_step_detect = 1036 - mma9553_get_event(data, IIO_STEPS, IIO_NO_MOD, IIO_EV_DIR_NONE); 1032 + ev_prev_activity = mma9553_get_event(data, IIO_ACTIVITY, 1033 + mma9553_activity_to_mod( 1034 + data->activity), 1035 + IIO_EV_DIR_FALLING); 1036 + ev_activity = mma9553_get_event(data, IIO_ACTIVITY, 1037 + mma9553_activity_to_mod(activity), 1038 + IIO_EV_DIR_RISING); 1039 + ev_step_detect = mma9553_get_event(data, IIO_STEPS, IIO_NO_MOD, 1040 + IIO_EV_DIR_NONE); 1037 1041 1038 1042 if (ev_step_detect->enabled && (stepcnt != data->stepcnt)) { 1039 1043 data->stepcnt = stepcnt; 1040 1044 iio_push_event(indio_dev, 1041 1045 IIO_EVENT_CODE(IIO_STEPS, 0, IIO_NO_MOD, 1042 - IIO_EV_DIR_NONE, IIO_EV_TYPE_CHANGE, 0, 0, 0), 1046 + IIO_EV_DIR_NONE, 1047 + IIO_EV_TYPE_CHANGE, 0, 0, 0), 1043 1048 data->timestamp); 1044 1049 } 1045 1050 ··· 1049 1054 if (ev_prev_activity && ev_prev_activity->enabled) 1050 1055 iio_push_event(indio_dev, 1051 1056 IIO_EVENT_CODE(IIO_ACTIVITY, 0, 1052 - ev_prev_activity->info->mod, 1053 - IIO_EV_DIR_FALLING, 1054 - IIO_EV_TYPE_THRESH, 0, 0, 0), 1057 + ev_prev_activity->info->mod, 1058 + IIO_EV_DIR_FALLING, 1059 + IIO_EV_TYPE_THRESH, 0, 0, 1060 + 0), 1055 1061 data->timestamp); 1056 1062 1057 1063 if (ev_activity && ev_activity->enabled) 1058 1064 iio_push_event(indio_dev, 1059 1065 IIO_EVENT_CODE(IIO_ACTIVITY, 0, 1060 - ev_activity->info->mod, 1061 - IIO_EV_DIR_RISING, 1062 - IIO_EV_TYPE_THRESH, 0, 0, 0), 1066 + ev_activity->info->mod, 1067 + IIO_EV_DIR_RISING, 1068 + IIO_EV_TYPE_THRESH, 0, 0, 1069 + 0), 1063 1070 data->timestamp); 1064 1071 } 1065 1072 mutex_unlock(&data->mutex); ··· 1156 1159 client->irq); 1157 1160 goto out_poweroff; 1158 1161 } 1159 - 1160 1162 } 1161 1163 1162 1164 ret = iio_device_register(indio_dev);