misc: eeprom: clean up eeprom_read()
authorVladimir Zapolskiy <vz@mleia.com>
Sun, 26 Jul 2015 21:18:49 +0000 (00:18 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2015 20:53:40 +0000 (13:53 -0700)
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 <vz@mleia.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/eeprom/eeprom.c

index b432873def96b5f489a50279205b0df0c7070453..7342fd637031335a21ed4779442ca69eb39fb045 100644 (file)
@@ -88,11 +88,6 @@ static ssize_t eeprom_read(struct file *filp, struct kobject *kobj,
        struct eeprom_data *data = i2c_get_clientdata(client);
        u8 slice;
 
-       if (off > EEPROM_SIZE)
-               return 0;
-       if (off + count > EEPROM_SIZE)
-               count = EEPROM_SIZE - off;
-
        /* Only refresh slices which contain requested bytes */
        for (slice = off >> 5; slice <= (off + count - 1) >> 5; slice++)
                eeprom_update_client(client, slice);