summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-cmos.c
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vz@mleia.com>2015-07-27 00:48:26 +0300
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2015-09-05 13:19:09 +0200
commita3781639e148497d7381d8786aaefe9f8b7e3028 (patch)
tree94e5af36cdd5a57bceb5f91d8c038b23dd584272 /drivers/rtc/rtc-cmos.c
parent3c217e51d8a272b9301058fe845d6c69cc0651cb (diff)
downloadop-kernel-dev-a3781639e148497d7381d8786aaefe9f8b7e3028.zip
op-kernel-dev-a3781639e148497d7381d8786aaefe9f8b7e3028.tar.gz
rtc: cmos: clean up cmos_nvram_read()/cmos_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>
Diffstat (limited to 'drivers/rtc/rtc-cmos.c')
-rw-r--r--drivers/rtc/rtc-cmos.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index c2e90c6..8f7034b 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -467,13 +467,6 @@ cmos_nvram_read(struct file *filp, struct kobject *kobj,
{
int retval;
- if (unlikely(off >= attr->size))
- return 0;
- if (unlikely(off < 0))
- return -EINVAL;
- if ((off + count) > attr->size)
- count = attr->size - off;
-
off += NVRAM_OFFSET;
spin_lock_irq(&rtc_lock);
for (retval = 0; count; count--, off++, retval++) {
@@ -498,12 +491,6 @@ cmos_nvram_write(struct file *filp, struct kobject *kobj,
int retval;
cmos = dev_get_drvdata(container_of(kobj, struct device, kobj));
- if (unlikely(off >= attr->size))
- return -EFBIG;
- if (unlikely(off < 0))
- return -EINVAL;
- if ((off + count) > attr->size)
- count = attr->size - off;
/* NOTE: on at least PCs and Ataris, the boot firmware uses a
* checksum on part of the NVRAM data. That's currently ignored
OpenPOWER on IntegriCloud