summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorVladimir Zapolskiy2015-07-26 23:18:46 +0200
committerGreg Kroah-Hartman2015-08-05 22:53:39 +0200
commitacb921a5a1e5fb2b864be25caf7317531f91a832 (patch)
treec9f0d9414a08489a5b94606712c6f01aaf5351c7 /drivers/misc
parentfs/char_dev.c: fix incorrect documentation for unregister_chrdev_region (diff)
downloadkernel-qcow2-linux-acb921a5a1e5fb2b864be25caf7317531f91a832.tar.gz
kernel-qcow2-linux-acb921a5a1e5fb2b864be25caf7317531f91a832.tar.xz
kernel-qcow2-linux-acb921a5a1e5fb2b864be25caf7317531f91a832.zip
misc: cxl: clean up afu_read_config()
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>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/cxl/sysfs.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/misc/cxl/sysfs.c b/drivers/misc/cxl/sysfs.c
index 31f38bc71a3d..87cd747bb511 100644
--- a/drivers/misc/cxl/sysfs.c
+++ b/drivers/misc/cxl/sysfs.c
@@ -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);