rtc: tx4939: clean up tx4939_rtc_nvram_read()/tx4939_rtc_nvram_write()
authorVladimir Zapolskiy <vz@mleia.com>
Sun, 26 Jul 2015 21:48:36 +0000 (00:48 +0300)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sat, 5 Sep 2015 11:19:10 +0000 (13:19 +0200)
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>
drivers/rtc/rtc-tx4939.c

index cb7f94ede5165b96b4adbdb8b382af6f39d792a0..560d9a5e02253fe3ef5cf159c71d94198498b45c 100644 (file)
@@ -199,8 +199,7 @@ static ssize_t tx4939_rtc_nvram_read(struct file *filp, struct kobject *kobj,
        ssize_t count;
 
        spin_lock_irq(&pdata->lock);
-       for (count = 0; size > 0 && pos < TX4939_RTC_REG_RAMSIZE;
-            count++, size--) {
+       for (count = 0; count < size; count++) {
                __raw_writel(pos++, &rtcreg->adr);
                *buf++ = __raw_readl(&rtcreg->dat);
        }
@@ -218,8 +217,7 @@ static ssize_t tx4939_rtc_nvram_write(struct file *filp, struct kobject *kobj,
        ssize_t count;
 
        spin_lock_irq(&pdata->lock);
-       for (count = 0; size > 0 && pos < TX4939_RTC_REG_RAMSIZE;
-            count++, size--) {
+       for (count = 0; count < size; count++) {
                __raw_writel(pos++, &rtcreg->adr);
                __raw_writel(*buf++, &rtcreg->dat);
        }
This page took 0.028091 seconds and 5 git commands to generate.