Received: by 10.213.65.68 with SMTP id h4csp393014imn; Tue, 3 Apr 2018 23:46:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx49YiTcRdpKv+J05Mjd2OOC8dhNNx02ot/jf8cnTq2ZyKwVHI6WmAYuA6edupEuLK7LF7521 X-Received: by 2002:a17:902:28c4:: with SMTP id f62-v6mr17416011plb.19.1522824387036; Tue, 03 Apr 2018 23:46:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522824386; cv=none; d=google.com; s=arc-20160816; b=0SQdAb0obz9X+G/g1Bij1dZwc18je+BOB3h0sEaBtNAPfCnSmyYMLQTpFMsTjXGt2I 0Fs8n67xvuz0uhIhXoLxhptp1l4Di1aWS0vWZ/4MTo7rOlEq1tUuvsoHq79Gs0GKbJsp +cmMV61EnDmi+UgXFc6C6E5JdzZpJ8ANx1klLBvF8qgXIuXtrAKeS6Hzu06JJTxdaPme ZyKpu0NrxnnjQAkc4/F7auCWoqdZtUnjMFljonOYjbGVnP3tjQrNF7Je0URnqcy3/FQq dBFDgwOD9bPibrK055iPjm4kZ/jueG7jjbCu7R26YLkfxmdWh3ujzfJcJ+gaTHTtJWyZ LsnA== 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:arc-authentication-results; bh=BsfYGvDzSh7EJ7+dZ5Llz6+3g/FQSOotAOQf3CIn0IM=; b=l+elCRlvnjNgESCZLnrNu0WW0YC62gNWGhkAghmjJzqkIxHtGgT2pyGBo47bZEf3m2 603hwsPYz3CvIUsl66jbsZVeCpGMJLByf0jhlKgg5aqS6RhnDhfcWfGprMf8KsTSs6MI qYlBwxay6+nj61+fLhjZZcfBSqu5f2D/bSfuGFE6DMDKNP9IV1TW1eg+D8XGIY4WKIs4 F/sZrKxdHW4Z9D/pKelg8DGlnw7URX0/B86LGRtGCBxP9tlUTeXFBhVI3qk3xc/lU27C dBCEadMeNHwgGj6NGBRsITnnt9eE5+1FbKbRxJugdC5IcaCnqtkvbBq0AaohqbZ+B3Si wALQ== ARC-Authentication-Results: i=1; mx.google.com; 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 k9si3221503pgr.146.2018.04.03.23.46.12; Tue, 03 Apr 2018 23:46:26 -0700 (PDT) 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; 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 S1751179AbeDDGpF (ORCPT + 99 others); Wed, 4 Apr 2018 02:45:05 -0400 Received: from mail.bootlin.com ([62.4.15.54]:37558 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750736AbeDDGpD (ORCPT ); Wed, 4 Apr 2018 02:45:03 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 298382064B; Wed, 4 Apr 2018 08:45:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id D4C862037A; Wed, 4 Apr 2018 08:45:01 +0200 (CEST) Date: Wed, 4 Apr 2018 08:45:01 +0200 From: Maxime Ripard To: Sergey Suloev Cc: Mark Brown , Chen-Yu Tsai , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/6] spi: sun6i: coding style/readability improvements Message-ID: <20180404064501.3sfo67ynkplk4vyx@flea> References: <20180403154449.2443-1-ssuloev@orpaltech.com> <20180403154449.2443-2-ssuloev@orpaltech.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gcvk7fpi35c7tfij" Content-Disposition: inline In-Reply-To: <20180403154449.2443-2-ssuloev@orpaltech.com> User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --gcvk7fpi35c7tfij Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 03, 2018 at 06:44:44PM +0300, Sergey Suloev wrote: > Minor changes to fulfill the coding style and improve > the readability of the code. >=20 > Changes in v2: > 1) Fixed issue with misplacing a piece of code that requires access > to the transfer structure into sun6i_spi_prepare_message() function > where the transfer structure is not available. This shouldn't be in your commit log. > Signed-off-by: Sergey Suloev > --- > drivers/spi/spi-sun6i.c | 97 +++++++++++++++++++++++++++++--------------= ------ > 1 file changed, 58 insertions(+), 39 deletions(-) >=20 > diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c > index 8533f4e..88ad45e 100644 > --- a/drivers/spi/spi-sun6i.c > +++ b/drivers/spi/spi-sun6i.c > @@ -88,8 +88,12 @@ > #define SUN6I_TXDATA_REG 0x200 > #define SUN6I_RXDATA_REG 0x300 > =20 > +#define SUN6I_SPI_MODE_BITS (SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LS= B_FIRST) > + > +#define SUN6I_SPI_MAX_SPEED_HZ 100000000 > +#define SUN6I_SPI_MIN_SPEED_HZ 3000 > + > struct sun6i_spi { > - struct spi_master *master; > void __iomem *base_addr; > struct clk *hclk; > struct clk *mclk; > @@ -189,6 +193,9 @@ static void sun6i_spi_set_cs(struct spi_device *spi, = bool enable) > else > reg &=3D ~SUN6I_TFR_CTL_CS_LEVEL; > =20 > + /* We want to control the chip select manually */ > + reg |=3D SUN6I_TFR_CTL_CS_MANUAL; > + > sun6i_spi_write(sspi, SUN6I_TFR_CTL_REG, reg); > } > =20 > @@ -197,6 +204,39 @@ static size_t sun6i_spi_max_transfer_size(struct spi= _device *spi) > return SUN6I_MAX_XFER_SIZE - 1; > } > =20 > +static int sun6i_spi_prepare_message(struct spi_master *master, > + struct spi_message *msg) > +{ > + struct spi_device *spi =3D msg->spi; > + struct sun6i_spi *sspi =3D spi_master_get_devdata(master); > + u32 reg; > + > + /* > + * Setup the transfer control register: Chip Select, > + * polarities, etc. > + */ > + reg =3D sun6i_spi_read(sspi, SUN6I_TFR_CTL_REG); > + > + if (spi->mode & SPI_CPOL) > + reg |=3D SUN6I_TFR_CTL_CPOL; > + else > + reg &=3D ~SUN6I_TFR_CTL_CPOL; > + > + if (spi->mode & SPI_CPHA) > + reg |=3D SUN6I_TFR_CTL_CPHA; > + else > + reg &=3D ~SUN6I_TFR_CTL_CPHA; > + > + if (spi->mode & SPI_LSB_FIRST) > + reg |=3D SUN6I_TFR_CTL_FBS; > + else > + reg &=3D ~SUN6I_TFR_CTL_FBS; > + > + sun6i_spi_write(sspi, SUN6I_TFR_CTL_REG, reg); > + > + return 0; > +} > + You're doing way more than just "coding style improvements", please split the patches accordingly. And slow down between versions, you had 0 review on the v1 and the v2, and you're at v3 already in just a couple of days. Maxime --=20 Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com --gcvk7fpi35c7tfij Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlrEdGwACgkQ0rTAlCFN r3R06A/+Ledb/akRsFwWs9PD4e8hkX3LCy7FQFRi3NxtNwiftrWvd3+QD8HWBe49 9gHNSdcylBDsrIcefhmzPtPNyXoVJmmIjuV7+GQyesmo7NVxAV53IsqvccYvriGk 6P130mGhzB9m8edu/Tb6SHi+1OHMRTcXkS+bOxabbksUpC0F7CfqZGn0mHx+EgT/ w4r2H8vA9i9pjJZmWWrvy4PkblGfZVW3/5aufZtJYD3JIH+hIAryx5415kcZ6y3B LEvZ/2WYofbgQNFq37uEzRnUyVJ/7IbG3zOX01gBmWpyWJ94rBzJKHumnD4chs2T H3j8izQ/TrxPcjfS8rLxV0f6M1X6MQ7kI8zntD19dt/qr0blz6i4NdSgWS53Ykgx xdYgBbN3fEIAfmEBtLPqg6X9Zy2EIJGUhYrsCYgd1SWDU5q+MQvxRyr+x1gM3qWG 348sbPDAyO+Rg2JfXtCSm5pUOt4gTlynhsrWzbsvilUiPE3X75bzl0bi2ZZYe7k3 U1NcccN+63Ag9Vm+Hv9+XsmUEDt44+JoNcQF6GSkZemAcyxiJVh1IVvEq3hL81xr CXDVu5H9qixhOStNgbug4XAl38b4hOeFMWFBd9XBPlNNodSUMfXyZEgR0iGtyHuy vEZCuYAFv3+DneM7ZZoQp8puqv6c6GU5udso+wNsK8FjWpwnJpw= =r6iy -----END PGP SIGNATURE----- --gcvk7fpi35c7tfij--