From: Vladimir Zapolskiy Date: Sun, 26 Jul 2015 21:18:50 +0000 (+0300) Subject: misc: eeprom: max6875: clean up max6875_read() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2664e0386e813158b599a73164f8f7ddb2b0eb6d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git misc: eeprom: max6875: clean up max6875_read() The change removes redundant sysfs binary file boundary check, since this task is already done on caller side in fs/sysfs/file.c Signed-off-by: Vladimir Zapolskiy Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/eeprom/max6875.c b/drivers/misc/eeprom/max6875.c index 580ff9df5529..9aa4332a6b04 100644 --- a/drivers/misc/eeprom/max6875.c +++ b/drivers/misc/eeprom/max6875.c @@ -114,12 +114,6 @@ static ssize_t max6875_read(struct file *filp, struct kobject *kobj, struct max6875_data *data = i2c_get_clientdata(client); int slice, max_slice; - if (off > USER_EEPROM_SIZE) - return 0; - - if (off + count > USER_EEPROM_SIZE) - count = USER_EEPROM_SIZE - off; - /* refresh slices which contain requested bytes */ max_slice = (off + count - 1) >> SLICE_BITS; for (slice = (off >> SLICE_BITS); slice <= max_slice; slice++)