From: Michael Neuling <mikey@neuling.org>
To: Vladimir Zapolskiy <vz@mleia.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
Ian Munsie <imunsie@au1.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: [PATCH 1/8] misc: cxl: clean up afu_read_config()
Date: Wed, 05 Aug 2015 17:48:00 +1000 [thread overview]
Message-ID: <1438760880.20978.2.camel@neuling.org> (raw)
In-Reply-To: <1437945533-27996-1-git-send-email-vz@mleia.com>
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 <imunsie@au1.ibm.com>
> Cc: Michael Neuling <mikey@neuling.org>
Acked-by: Michael Neuling <mikey@neuling.org>
> ---
> drivers/misc/cxl/sysfs.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>=20
> diff --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);
WARNING: multiple messages have this Message-ID (diff)
From: Michael Neuling <mikey@neuling.org>
To: Vladimir Zapolskiy <vz@mleia.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
Ian Munsie <imunsie@au1.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: [PATCH 1/8] misc: cxl: clean up afu_read_config()
Date: Wed, 05 Aug 2015 17:48:00 +1000 [thread overview]
Message-ID: <1438760880.20978.2.camel@neuling.org> (raw)
In-Reply-To: <1437945533-27996-1-git-send-email-vz@mleia.com>
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
>
> Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: Ian Munsie <imunsie@au1.ibm.com>
> Cc: Michael Neuling <mikey@neuling.org>
Acked-by: Michael Neuling <mikey@neuling.org>
> ---
> drivers/misc/cxl/sysfs.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --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, 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);
next prev parent reply other threads:[~2015-08-05 7:48 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-26 21:18 [PATCH 0/8] misc: remove boundary checks from bin attr users Vladimir Zapolskiy
2015-07-26 21:18 ` Vladimir Zapolskiy
2015-07-26 21:18 ` Vladimir Zapolskiy
2015-07-26 21:18 ` [PATCH 1/8] misc: cxl: clean up afu_read_config() Vladimir Zapolskiy
2015-07-26 23:06 ` Daniel Axtens
2015-08-05 7:48 ` Michael Neuling [this message]
2015-08-05 7:48 ` Michael Neuling
2015-07-26 21:18 ` [PATCH 2/8] misc: ds1682: clean up ds1682_eeprom_read() and ds1682_eeprom_write() Vladimir Zapolskiy
2015-07-26 21:18 ` [PATCH 3/8] misc: eeprom: 93xx46: clean up eeprom_93xx46_bin_read/write Vladimir Zapolskiy
2015-07-26 21:18 ` [PATCH 4/8] misc: eeprom: clean up eeprom_read() Vladimir Zapolskiy
2015-07-29 7:14 ` Jean Delvare
2015-07-26 21:18 ` [PATCH 5/8] misc: eeprom: max6875: clean up max6875_read() Vladimir Zapolskiy
[not found] ` <1437945502-27944-1-git-send-email-vz-ChpfBGZJDbMAvxtiuMwx3w@public.gmane.org>
2015-07-26 21:18 ` [PATCH 6/8] misc: eeprom: at24: clean up at24_bin_write() Vladimir Zapolskiy
2015-07-26 21:18 ` Vladimir Zapolskiy
[not found] ` <1437945533-27996-6-git-send-email-vz-ChpfBGZJDbMAvxtiuMwx3w@public.gmane.org>
2015-07-28 6:11 ` Wolfram Sang
2015-07-28 6:11 ` Wolfram Sang
2015-07-26 21:18 ` [PATCH 7/8] misc: eeprom: at25: move eeprom boundary checks to mem_read/mem_write Vladimir Zapolskiy
2015-07-26 21:18 ` [PATCH 8/8] misc: eeprom: sunxi_sid: clean up sid_read() Vladimir Zapolskiy
2015-07-26 21:18 ` Vladimir Zapolskiy
2015-08-07 16:10 ` [PATCH 0/8] misc: remove boundary checks from bin attr users Wolfram Sang
2015-08-07 16:10 ` Wolfram Sang
2015-08-07 16:15 ` Vladimir Zapolskiy
2015-08-07 16:15 ` Vladimir Zapolskiy
2015-08-07 16:15 ` Vladimir Zapolskiy
2015-08-07 22:34 ` Wolfram Sang
2015-08-07 22:34 ` Wolfram Sang
2015-08-08 12:51 ` Vladimir Zapolskiy
2015-08-08 12:51 ` Vladimir Zapolskiy
2015-08-08 12:51 ` Vladimir Zapolskiy
[not found] ` <55C5FB6A.5010300-ChpfBGZJDbMAvxtiuMwx3w@public.gmane.org>
2015-08-08 16:49 ` Wolfram Sang
2015-08-08 16:49 ` Wolfram Sang
2015-08-08 16:49 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1438760880.20978.2.camel@neuling.org \
--to=mikey@neuling.org \
--cc=gregkh@linuxfoundation.org \
--cc=imunsie@au1.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=vz@mleia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.