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

rtc: rp5c01: clean up rp5c01_nvram_read()/rp5c01_nvram_write()

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>

authored by

Vladimir Zapolskiy and committed by
Alexandre Belloni
d1cf4bde 99be3e37

+2 -2
+2 -2
drivers/rtc/rtc-rp5c01.c
··· 170 170 171 171 spin_lock_irq(&priv->lock); 172 172 173 - for (count = 0; size > 0 && pos < RP5C01_MODE; count++, size--) { 173 + for (count = 0; count < size; count++) { 174 174 u8 data; 175 175 176 176 rp5c01_write(priv, ··· 200 200 201 201 spin_lock_irq(&priv->lock); 202 202 203 - for (count = 0; size > 0 && pos < RP5C01_MODE; count++, size--) { 203 + for (count = 0; count < size; count++) { 204 204 u8 data = *buf++; 205 205 206 206 rp5c01_write(priv,