Re: [PATCH 1/8] misc: cxl: clean up afu_read_config()
From: Michael Neuling <hidden>
Date: 2015-08-05 07:48:21
Also in:
lkml
On Mon, 2015-07-27 at 00:18 +0300, Vladimir Zapolskiy wrote:
The sanity checks for overflow are not needed, because this is done on caller side in fs/sysfs/file.c =20 Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Cc: linuxppc-dev@lists.ozlabs.org Cc: Ian Munsie <redacted> Cc: Michael Neuling <redacted>
Acked-by: Michael Neuling <redacted>
quoted hunk ↗ jump to hunk
--- drivers/misc/cxl/sysfs.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) =20diff --git a/drivers/misc/cxl/sysfs.c b/drivers/misc/cxl/sysfs.c index 31f38bc..87cd747 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, st=
ruct kobject *kobj,
struct afu_config_record *cr =3D to_cr(kobj); struct cxl_afu *afu =3D to_cxl_afu(container_of(kobj->parent, struct de=
vice, kobj));
=20
- u64 i, j, val, size =3D afu->crs_len;
-
- if (off > size)
- return 0;
- if (off + count > size)
- count =3D size - off;
+ u64 i, j, val;
=20
for (i =3D 0; i < count;) {
val =3D cxl_afu_cr_read64(afu, cr->cr, off & ~0x7);