Skip to content

Commit

Permalink
rtc: rp5c01: clean up rp5c01_nvram_read()/rp5c01_nvram_write()
Browse files Browse the repository at this point in the history
The change removes redundant sysfs binary file boundary checks, since
this task is already done on caller side in fs/sysfs/file.c

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
  • Loading branch information
vzapolskiy authored and alexandrebelloni committed Sep 5, 2015
1 parent 99be3e3 commit d1cf4bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/rtc/rtc-rp5c01.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ static ssize_t rp5c01_nvram_read(struct file *filp, struct kobject *kobj,

spin_lock_irq(&priv->lock);

for (count = 0; size > 0 && pos < RP5C01_MODE; count++, size--) {
for (count = 0; count < size; count++) {
u8 data;

rp5c01_write(priv,
Expand Down Expand Up @@ -200,7 +200,7 @@ static ssize_t rp5c01_nvram_write(struct file *filp, struct kobject *kobj,

spin_lock_irq(&priv->lock);

for (count = 0; size > 0 && pos < RP5C01_MODE; count++, size--) {
for (count = 0; count < size; count++) {
u8 data = *buf++;

rp5c01_write(priv,
Expand Down

0 comments on commit d1cf4bd

Please sign in to comment.