misc: cxl: clean up afu_read_config()
authorVladimir Zapolskiy <vz@mleia.com>
Sun, 26 Jul 2015 21:18:46 +0000 (00:18 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2015 20:53:39 +0000 (13:53 -0700)
The sanity checks for overflow are not needed, because this is done on
caller side in fs/sysfs/file.c

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Cc: Ian Munsie <imunsie@au1.ibm.com>
Acked-by: Michael Neuling <mikey@neuling.org>
Reviewed-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/cxl/sysfs.c

index 31f38bc71a3d5d113263998141b62c4b9285d343..87cd747bb511c83f000023d4b1fc49714d3df598 100644 (file)
@@ -443,12 +443,7 @@ static ssize_t afu_read_config(struct file *filp, struct kobject *kobj,
        struct afu_config_record *cr = to_cr(kobj);
        struct cxl_afu *afu = to_cxl_afu(container_of(kobj->parent, struct device, kobj));
 
-       u64 i, j, val, size = afu->crs_len;
-
-       if (off > size)
-               return 0;
-       if (off + count > size)
-               count = size - off;
+       u64 i, j, val;
 
        for (i = 0; i < count;) {
                val = cxl_afu_cr_read64(afu, cr->cr, off & ~0x7);