mirror of
https://github.com/torvalds/linux.git
synced 2024-12-29 06:12:08 +00:00
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>
This commit is contained in:
parent
1c02cbfec5
commit
01835fadf5
@ -89,10 +89,8 @@ static int ds1374_read_rtc(struct i2c_client *client, u32 *time,
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
if (nbytes > 4) {
|
||||
WARN_ON(1);
|
||||
if (WARN_ON(nbytes > 4))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = i2c_smbus_read_i2c_block_data(client, reg, nbytes, buf);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user