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

rtc: stk17ta8: clean up stk17ta8_nvram_read()/stk17ta8_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
ecc663c3 d1cf4bde

+2 -2
+2 -2
drivers/rtc/rtc-stk17ta8.c
··· 254 254 void __iomem *ioaddr = pdata->ioaddr; 255 255 ssize_t count; 256 256 257 - for (count = 0; size > 0 && pos < RTC_OFFSET; count++, size--) 257 + for (count = 0; count < size; count++) 258 258 *buf++ = readb(ioaddr + pos++); 259 259 return count; 260 260 } ··· 269 269 void __iomem *ioaddr = pdata->ioaddr; 270 270 ssize_t count; 271 271 272 - for (count = 0; size > 0 && pos < RTC_OFFSET; count++, size--) 272 + for (count = 0; count < size; count++) 273 273 writeb(*buf++, ioaddr + pos++); 274 274 return count; 275 275 }