diff options
author | Srikant Ritolia <s.ritolia@samsung.com> | 2016-11-29 06:04:37 -0500 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2016-12-07 10:34:43 -0500 |
commit | 01835fadf5eda4afdca5c0aa7a89e210ee45bec6 (patch) | |
tree | f3b0f494f0352e3aeb5ec39e38e92f2d500f6da1 | |
parent | 1c02cbfec5c7754cb16456fcb26592a20781cdff (diff) |
rtc: ds1374: Merge conditional + WARN_ON()
WARN_ON does both these things in one statement.
Using a better pattern with WARN_ON().
Signed-off-by: Srikant Ritolia <s.ritolia@samsung.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
-rw-r--r-- | drivers/rtc/rtc-ds1374.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c index 3b3049c8c9e0..52429f0a57cc 100644 --- a/drivers/rtc/rtc-ds1374.c +++ b/drivers/rtc/rtc-ds1374.c | |||
@@ -89,10 +89,8 @@ static int ds1374_read_rtc(struct i2c_client *client, u32 *time, | |||
89 | int ret; | 89 | int ret; |
90 | int i; | 90 | int i; |
91 | 91 | ||
92 | if (nbytes > 4) { | 92 | if (WARN_ON(nbytes > 4)) |
93 | WARN_ON(1); | ||
94 | return -EINVAL; | 93 | return -EINVAL; |
95 | } | ||
96 | 94 | ||
97 | ret = i2c_smbus_read_i2c_block_data(client, reg, nbytes, buf); | 95 | ret = i2c_smbus_read_i2c_block_data(client, reg, nbytes, buf); |
98 | 96 | ||