Path: csiph.com!aioe.org!bofh.it!news.nic.it!robomod From: Daniel Axtens 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: References: X-Original-To: Vladimir Zapolskiy 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: 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 , Michael Neuling , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Ian Munsie 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 --=-D9zqCHhwTF4rxmkG8/GG Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Reviewed-by: Daniel Axtens 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 >=20 > Signed-off-by: Vladimir Zapolskiy > Cc: linuxppc-dev@lists.ozlabs.org > Cc: Ian Munsie > Cc: Michael Neuling > --- > 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); --=-D9zqCHhwTF4rxmkG8/GG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: GPGTools - https://gpgtools.org iQIcBAABCgAGBQJVtWfnAAoJEPC3R3P2I92FTVoP/RUopov9Rq2zPs14JIsMrGbv GDGNAWxCoKeHopeMTttENPItWAIeUx26NWaqY1T/XSbUcx91h0WCz1Ww/7yoQz5K WYqMgguSawrGR0Sy43yAc6gQM1C+D8n2ow+7i+b5D1bQp7FZGAHkaNdLNXuHHNlU QT2zymKINVfulXrxI6d+du/1QWjDkvum23N8rxRS9fGDfAztqoI3bacpuD7V9G+F YPtoryi94HDwFXTPqbRxElCsDnVaQYjzIzlcdO+24n3UGpwzaIrJEQ8RH/fA3tDX WrSioaVpGs3zBz1XBXRP8CAFdKfSuduVSjVhahL530QXWmcQQLwHap9JD8o8w9xX EcdM5FeMhTBcBMDmt5gGsh/J0E9FieDGtHgh8ZaRqIVHs4AEiR40SDXg9/5eizdn b62FAqjj9bRFti6sFaz+O1i11IJzcDhGaFWsIpQFavkLtT9hGvogSdqTJUHuTKTc ezwxjI992CCQ85i5OC4rDvEqI8NwfNgmUo3Xy6KwQRVUEwBlYxxC8I1XRDu/JyIA m+jUyV6DEU3QZ9WVL99Qq4dN/u4qA+PZt3nA6RbR98XW7A1ktt03I+LbsHYCdftU XIILkSyIi5bCnvjwYmEjIdei8gPYU/eN4yPj5rgoxxLyXUomQQ6uNDY5YlB6f4uZ zweaO8gS3OJyXisiybtG =UOzo -----END PGP SIGNATURE----- --=-D9zqCHhwTF4rxmkG8/GG-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/