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

drivers/rtc/rtc-x1205.c: fix checkpatch issues

Fixes the following types of issues:

ERROR: do not use assignment in if condition
ERROR: open brace '{' following struct go on the same line
ERROR: else should follow close brace '}'
WARNING: please, no space before tabs

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Sachin Kamat and committed by
Linus Torvalds
66e3f10c 0218bcf6

+20 -13
+20 -13
drivers/rtc/rtc-x1205.c
··· 4 4 * Copyright 2005 Alessandro Zummo 5 5 * 6 6 * please send all reports to: 7 - * Karen Spearel <kas111 at gmail dot com> 7 + * Karen Spearel <kas111 at gmail dot com> 8 8 * Alessandro Zummo <a.zummo@towertech.it> 9 9 * 10 10 * based on a lot of other RTC drivers. ··· 215 215 buf[i] |= 0x80; 216 216 217 217 /* this sequence is required to unlock the chip */ 218 - if ((xfer = i2c_master_send(client, wel, 3)) != 3) { 218 + xfer = i2c_master_send(client, wel, 3); 219 + if (xfer != 3) { 219 220 dev_err(&client->dev, "%s: wel - %d\n", __func__, xfer); 220 221 return -EIO; 221 222 } 222 223 223 - if ((xfer = i2c_master_send(client, rwel, 3)) != 3) { 224 + xfer = i2c_master_send(client, rwel, 3); 225 + if (xfer != 3) { 224 226 dev_err(&client->dev, "%s: rwel - %d\n", __func__, xfer); 225 227 return -EIO; 226 228 } ··· 271 269 } 272 270 273 271 /* disable further writes */ 274 - if ((xfer = i2c_master_send(client, diswe, 3)) != 3) { 272 + xfer = i2c_master_send(client, diswe, 3); 273 + if (xfer != 3) { 275 274 dev_err(&client->dev, "%s: diswe - %d\n", __func__, xfer); 276 275 return -EIO; 277 276 } ··· 378 375 return 0; 379 376 } 380 377 381 - struct x1205_limit 382 - { 378 + struct x1205_limit { 383 379 unsigned char reg, mask, min, max; 384 380 }; 385 381 ··· 432 430 }, 433 431 }; 434 432 435 - if ((xfer = i2c_transfer(client->adapter, msgs, 2)) != 2) { 433 + xfer = i2c_transfer(client->adapter, msgs, 2); 434 + if (xfer != 2) { 436 435 dev_err(&client->dev, 437 436 "%s: could not read register %x\n", 438 437 __func__, probe_zero_pattern[i]); ··· 470 467 }, 471 468 }; 472 469 473 - if ((xfer = i2c_transfer(client->adapter, msgs, 2)) != 2) { 470 + xfer = i2c_transfer(client->adapter, msgs, 2); 471 + if (xfer != 2) { 474 472 dev_err(&client->dev, 475 473 "%s: could not read register %x\n", 476 474 __func__, probe_limits_pattern[i].reg); ··· 552 548 { 553 549 int err, dtrim, atrim; 554 550 555 - if ((err = x1205_get_dtrim(to_i2c_client(dev), &dtrim)) == 0) 551 + err = x1205_get_dtrim(to_i2c_client(dev), &dtrim); 552 + if (!err) 556 553 seq_printf(seq, "digital_trim\t: %d ppm\n", dtrim); 557 554 558 - if ((err = x1205_get_atrim(to_i2c_client(dev), &atrim)) == 0) 555 + err = x1205_get_atrim(to_i2c_client(dev), &atrim); 556 + if (!err) 559 557 seq_printf(seq, "analog_trim\t: %d.%02d pF\n", 560 558 atrim / 1000, atrim % 1000); 561 559 return 0; ··· 645 639 i2c_set_clientdata(client, rtc); 646 640 647 641 /* Check for power failures and eventually enable the osc */ 648 - if ((err = x1205_get_status(client, &sr)) == 0) { 642 + err = x1205_get_status(client, &sr); 643 + if (!err) { 649 644 if (sr & X1205_SR_RTCF) { 650 645 dev_err(&client->dev, 651 646 "power failure detected, " ··· 654 647 udelay(50); 655 648 x1205_fix_osc(client); 656 649 } 657 - } 658 - else 650 + } else { 659 651 dev_err(&client->dev, "couldn't read status\n"); 652 + } 660 653 661 654 err = x1205_sysfs_register(&client->dev); 662 655 if (err)