Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2077440ybv; Fri, 21 Feb 2020 08:29:15 -0800 (PST) X-Google-Smtp-Source: APXvYqy4UydOoKZH3ho4QfIqJwwRourROh68Isvq6+sWLg0Su8+SI/l9/nhQQ6PzWQdhA38BzjUn X-Received: by 2002:a05:6808:611:: with SMTP id y17mr2597978oih.146.1582302555550; Fri, 21 Feb 2020 08:29:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582302555; cv=none; d=google.com; s=arc-20160816; b=QRiHGHPhmX6HtDft9dcawM2taaxwroyKffm992/9JL86HVX0sCYQfcVCOFRN1uRWry HeQJN4m+zK/ZR58I5F/LGll1JgCvXKB3Cbp1+BwsY/6esl0uPdpdV1H8qA1Et6l13Ibw U84G2yKHaJ1qrNlYH+uXJTfg1sNWqK3blU2AdFtyzckVkY3H/7dtWFvosmwKNqrR5pdp 9WAbLEJ0eXYB/fl3M5B3vpLra1/fkRu1v9VwRvjaN5PlEm+Z7yaNytQarke9JtCgVtSd Wokc/1k0D7XbZjTZD70vvQtZzmC6IzZZG0bxk7Dk/xQjIBEmL+ZNRlyvocnjExnS+bie FCgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=CPZqwsZsyRCoOPqJ5TLPnK7JrGU+JnShNc47vxgecn8=; b=hKL6QaUiu/YPI6F/Wl/ed6527Y3ooenycWnWlaUc88x9BOctjkeBNL6NrRLnV+oVun xSzOMmTPndkkwxMY7zxo4X5ketfDlFtyBY16x0fYCt3hhT9eNMRT64jqkiCjVqYDjDbW LboMRYEOzsjmsGoiUFW7H9BsLXq96QwTXrnVTw1GqR2DVHt+0Pi40e2et0VX7Vb68G2E 8JNCij3qeh7Vph2FxT77JruzbjDIF87MsvKLgmTB7sv9J0vXHNTfMerXE16ObsQfOtPd Ok36eBlc/0GlVwQwzdScj6CVEtOvN1bARzJyVRERqI5VfyfrpjmXVC2xOuJ66eqh29Do T3NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=kP8Rz3AF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h17si996566oib.234.2020.02.21.08.29.02; Fri, 21 Feb 2020 08:29:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=kP8Rz3AF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727329AbgBUQ2J (ORCPT + 99 others); Fri, 21 Feb 2020 11:28:09 -0500 Received: from mout.gmx.net ([212.227.17.20]:45247 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726562AbgBUQ2I (ORCPT ); Fri, 21 Feb 2020 11:28:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1582302487; bh=iZ4Md3zA+8TD9x9QKRbjlp2m/9bXeZixQfkesgDAkac=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=kP8Rz3AFpQWFFc8jVcaS5Oty5aD3KwMU7qCkFd8KsLVfoCiQsoiylxPN1eylRQGtt uH7+yP7hT3E0TVNsxQrlKxwNYXTsLf+QO/FLcVJ5MUycHNIPr4MLEz0g+Q6VssB1Mx l7jVfZWb+7lPtkL7qxsDbbjAzth69wwojeu8jc8I= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.194.18]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MLi8m-1ineBs3qV6-00HbeR; Fri, 21 Feb 2020 17:22:49 +0100 Date: Fri, 21 Feb 2020 17:22:48 +0100 From: Jonathan =?utf-8?Q?Neusch=C3=A4fer?= To: Tudor.Ambarus@microchip.com Cc: j.neuschaefer@gmx.net, linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mtd: spi-nor: Simplify loop in spi_nor_read_id() Message-ID: <20200221162248.GG2031@latitude> References: <20200218151034.24744-1-j.neuschaefer@gmx.net> <5604429.rq6fcmI4QA@localhost.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fwqqG+mf3f7vyBCB" Content-Disposition: inline In-Reply-To: <5604429.rq6fcmI4QA@localhost.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) X-Provags-ID: V03:K1:gwSw2P5bp5MrtvsX8GS9o9bSpULoPgmp11M6pF4Ku/78sHNr/JF P2ZE2CgtSpDSByK32+K/Xl1AXHZ1z9NWFvGLzuNSiVcyAd9Y6ZWwau6U2FdCWHrYdpK4LeS h/fL0T/MLF7am+a4r9xNNJQoAQKKEB/B1it4sskPOA7CkN8qHtjfiNaRwjUeTs5/38WfwW4 oVj7uMyay+CK1E0jX0PUg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:mQo1k0k4lkM=:a0bAAEnBvVQZpUHT08Rag4 m5xXvWsjB5VfXhkttzLkexJ1F3EeQGkYvCQ5fXQ64vNfpfXPv7prXbrgjSpDn6YB//h9kZgUV gGYOxaEuxw1pbifuH1BFsfDbWmF3leuo/nT+iSXAsykT2zyaPfmdy/pnuGQHMe+M79+5COqYO lUdtbc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LfE66HPXMvFx1wAnOYEYfbJJWB03e iEsQeMbKKP00qvnHw Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --fwqqG+mf3f7vyBCB Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 19, 2020 at 08:06:08AM +0000, Tudor.Ambarus@microchip.com wrote: [...] > > static const struct flash_info *spi_nor_read_id(struct spi_nor *nor) > > { > > - int tmp; > > + int tmp, i; >=20 > while cleaning this function, would you rename tmp with ret? Good idea, I'll do that in v2. > > u8 *id =3D nor->bouncebuf; >=20 > and please drop this tab between u8 and *id The same with the other variables in this functions? They have tabs between the type and the pointer star / name as well. >=20 > > const struct flash_info *info; >=20 > Also, IMO, the definition of variables should be done with the focus of= =20 > avoiding stack padding. With this in mind, I would first define the point= ers=20 > and then the ints and smaller types. But there are others than prefer def= ining=20 > the variables in a tree/reverse-tree way, depending of the length of the = line.=20 > There's no agreement on this, either way if fine, do as you prefer. I have no preference here. I think I'll keep it as is for now. Thanks for the review, Jonathan Neusch=C3=A4fer --fwqqG+mf3f7vyBCB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEvHAHGBBjQPVy+qvDCDBEmo7zX9sFAl5QA8sACgkQCDBEmo7z X9uH2Q//fzyLMsrdTB+uonzF2+F5EOdbALvPPFFgkuf08zQK5s/IVEXafKly3MDb aBxj7lBRRADOjT4+UBTVRUr2ouB1VRw4oF1+qy6Oz0Uwcz7UrnSAmq6MezY12Gqp wdfsOem2psiVOVEnAyeLbyFFTaBYqtX+GYc7Jyo3yfYh08iJ/ryFAPyppgahsQfv D7j13FFrkOuOEJ/PjWUYIedD9NvTCuUb9EJrgRdGB/PzQtnvdRh2bPnEaNe6HZMs xwOptqK8El9+RFT/PyXi7W/fxvTw2UxEYOZexUoJQL8OOb2w2kqz4VD1B7wZ5Vgw nI2TIghlZ7k2PB2FC9Lsg+IakSvkkDsvCKqzM4B3fIKkJOiE8TDTxHZoo5CVH3B+ A5GdvJGc0gdfV2GuF9QxigGTx2C178jsQBmrT8f8i8pK8507ZSbx7MXfypF6X0Ax gD0L5etKeJthGfDxc1sjywz/UEKF1kawXf5wVFhOHlZgruoePr7+RSna3iqgRAd1 QTx714TzBeeSBbTp9BINQnDb5FTgKgMQPCHKYlLjAsMgImEJ787AtlOyHhIAbPaq dh46BHs5SlTei1js7/mEZTY/WaAQkzNP/Q5mUnCu//lN2HkfDM6hD/yWMT9Xrtz6 QlRksCjxSVihsH8ojX98SphmCWOng1kAvL5MTGZHx0rfheUMf6Q= =ZS6o -----END PGP SIGNATURE----- --fwqqG+mf3f7vyBCB--