Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1192579

Re: [PATCH 1/8] misc: cxl: clean up afu_read_config()

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Daniel Axtens <dja@axtens.net>
Newsgroups linux.kernel
Subject Re: [PATCH 1/8] misc: cxl: clean up afu_read_config()
Date Mon, 27 Jul 2015 01:10:02 +0200
Message-ID <pQDdo-rc-5@gated-at.bofh.it> (permalink)
References <pQBEB-6zs-3@gated-at.bofh.it> <pQBEB-6zs-5@gated-at.bofh.it>
X-Original-To Vladimir Zapolskiy <vz@mleia.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version; bh=YefamkyUJiOXk56D8b5hMsfvXKQ/P9r59CJF+IOKaG8=; b=P9llIpBJc5E9fuojyKxi8vmjtWMNUQi/xzOzqHmKgLqOAAfDa61GCX6F6u3DilZMTU 47ckoR7f+YDBUBPuu02NkhNsRxyfPpI1sankQdWfVpciFf1YfZv0GevxB0EMHORBlgES GkWC8u6JxpufefWOd7JIYl6jz+FQ0Ye7sCU7E=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:mime-version; bh=YefamkyUJiOXk56D8b5hMsfvXKQ/P9r59CJF+IOKaG8=; b=nMItpG15dk6V+rRw+O0RM/2UKfxHnZeI2T6MeJDWTh427vOtdvODOietuIReftHQiU usT5vHIfQHTbcmSW2Z7Tks4GGtbr4BSjXEP6/jp9zjP09WSDByghctrHM1rSZlAAt/J6 korHUx68t3j9x1cQweWCVcUNTenHIjBMJ0H6mr7AXLnILRgD6PhjFLqvvO6/GdlO95na i/dR5VqCM5yQC4tR2vDhViGIC7tmM9mmYPyt428UcinPApca1uDNYNppXD+SmIW4VsVv hdPolKgUrE/zsH81bxeDUqIypifq+IMd9MqgzYhGUEt2D3Ga6pNSSNkjykhPO74t+bcp d7MA==
X-Gm-Message-State ALoCoQkKIPslOhRAiN97oQqKQuHvzx+x+9e5Nf3RSqwByHxJZGqGUjhRa7ZwHyB7dxZh6NbpaACN
X-Received by 10.66.161.135 with SMTP id xs7mr62428512pab.154.1437952090344; Sun, 26 Jul 2015 16:08:10 -0700 (PDT)
Content-Type multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-D9zqCHhwTF4rxmkG8/GG"
X-Mailer Evolution 3.12.11-1
MIME-Version 1.0
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 80
Organization linux.* mail to news gateway
X-Original-Cc Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Michael Neuling <mikey@neuling.org>, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Ian Munsie <imunsie@au1.ibm.com>
X-Original-Date Mon, 27 Jul 2015 09:06:06 +1000
X-Original-Message-ID <1437951966.6262.3.camel@axtens.net>
X-Original-References <1437945502-27944-1-git-send-email-vz@mleia.com> <1437945533-27996-1-git-send-email-vz@mleia.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1192579

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi,

Reviewed-by: Daniel Axtens <dja@axtens.net>

FWIW, Ian is on leave for 2 weeks and Mikey for 1 week. However, as one
of the other CXL developers I'm very happy for this patch to go in.

Regards,
Daniel

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>
> ---
>  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);

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH 1/8] misc: cxl: clean up afu_read_config() Daniel Axtens <dja@axtens.net> - 2015-07-27 01:10 +0200

csiph-web