From: Vladimir Zapolskiy Date: Sun, 26 Jul 2015 21:18:46 +0000 (+0300) Subject: misc: cxl: clean up afu_read_config() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=acb921a5a1e5fb2b864be25caf7317531f91a832;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Ian Munsie Acked-by: Michael Neuling Reviewed-by: Daniel Axtens Signed-off-by: Greg Kroah-Hartman --- 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);