]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
misc: eeprom: max6875: clean up max6875_read()
authorVladimir Zapolskiy <vz@mleia.com>
Sun, 26 Jul 2015 21:18:50 +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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/eeprom/max6875.c

index 580ff9df55296ccbb29e18561a98d7756e9c60b6..9aa4332a6b04d43034a93b54116ea7578d2a00bb 100644 (file)
@@ -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++)