Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: ds1343: clean up ds1343_nvram_read()/ds1343_nvram_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: Alexandre Belloni <alexandre.belloni@free-electrons.com>

authored by

Vladimir Zapolskiy and committed by
Alexandre Belloni
f4843b19 ca7c14d3

-12
-12
drivers/rtc/rtc-ds1343.c
··· 162 162 struct device *dev = kobj_to_dev(kobj); 163 163 struct ds1343_priv *priv = dev_get_drvdata(dev); 164 164 165 - if (unlikely(!count)) 166 - return count; 167 - 168 - if ((count + off) > DS1343_NVRAM_LEN) 169 - count = DS1343_NVRAM_LEN - off; 170 - 171 165 address = DS1343_NVRAM + off; 172 166 173 167 ret = regmap_bulk_write(priv->map, address, buf, count); ··· 180 186 unsigned char address; 181 187 struct device *dev = kobj_to_dev(kobj); 182 188 struct ds1343_priv *priv = dev_get_drvdata(dev); 183 - 184 - if (unlikely(!count)) 185 - return count; 186 - 187 - if ((count + off) > DS1343_NVRAM_LEN) 188 - count = DS1343_NVRAM_LEN - off; 189 189 190 190 address = DS1343_NVRAM + off; 191 191