[PATCH 8/8] misc: eeprom: sunxi_sid: clean up sid_read()

Vladimir Zapolskiy
2015-07-26T21:18:53Z

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>
Cc: linux-arm-kernel at lists.infradead.org
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
---
drivers/misc/eeprom/sunxi_sid.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/drivers/misc/eeprom/sunxi_sid.c b/drivers/misc/eeprom/sunxi_sid.c
index 8385177..26ce99d 100644
--- a/drivers/misc/eeprom/sunxi_sid.c
+++ b/drivers/misc/eeprom/sunxi_sid.c
@@ -70,11 +70,6 @@ static ssize_t sid_read(struct file *fd, struct kobject *kobj,
pdev = to_platform_device(kobj_to_dev(kobj));
sid_data = platform_get_drvdata(pdev);

- if (pos < 0 || pos >= sid_data->keysize)
- return 0;
- if (size > sid_data->keysize - pos)
- size = sid_data->keysize - pos;
-
for (i = 0; i < size; i++)
buf[i] = sunxi_sid_read_byte(sid_data, pos + i);

--
2.1.4