summaryrefslogtreecommitdiffstats
path: root/drivers/misc/eeprom
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vz@mleia.com>2015-07-26 23:18:48 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-08-05 22:53:40 +0200
commitb5da83d4a9c929ac197313b5d6c5d771447fb59e (patch)
tree4611867e3c33159fa5f9ed08e59858b6cfae1dde /drivers/misc/eeprom
parentmisc: ds1682: clean up ds1682_eeprom_read() and ds1682_eeprom_write() (diff)
downloadlinux-b5da83d4a9c929ac197313b5d6c5d771447fb59e.tar.xz
linux-b5da83d4a9c929ac197313b5d6c5d771447fb59e.zip
misc: eeprom: 93xx46: clean up eeprom_93xx46_bin_read/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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/eeprom')
-rw-r--r--drivers/misc/eeprom/eeprom_93xx46.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/misc/eeprom/eeprom_93xx46.c b/drivers/misc/eeprom/eeprom_93xx46.c
index 9ebeacdb8ec4..a6bd9e3fe9d3 100644
--- a/drivers/misc/eeprom/eeprom_93xx46.c
+++ b/drivers/misc/eeprom/eeprom_93xx46.c
@@ -48,13 +48,6 @@ eeprom_93xx46_bin_read(struct file *filp, struct kobject *kobj,
dev = container_of(kobj, struct device, kobj);
edev = dev_get_drvdata(dev);
- if (unlikely(off >= edev->bin.size))
- return 0;
- if ((off + count) > edev->bin.size)
- count = edev->bin.size - off;
- if (unlikely(!count))
- return count;
-
cmd_addr = OP_READ << edev->addrlen;
if (edev->addrlen == 7) {
@@ -200,13 +193,6 @@ eeprom_93xx46_bin_write(struct file *filp, struct kobject *kobj,
dev = container_of(kobj, struct device, kobj);
edev = dev_get_drvdata(dev);
- if (unlikely(off >= edev->bin.size))
- return -EFBIG;
- if ((off + count) > edev->bin.size)
- count = edev->bin.size - off;
- if (unlikely(!count))
- return count;
-
/* only write even number of bytes on 16-bit devices */
if (edev->addrlen == 6) {
step = 2;