Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp453821imm; Tue, 15 May 2018 04:19:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrcDY/XcwEMw9UgOqaRU6eFlbdAD3LpMcGKEFb7TckFhi+/QhkkNI+530c7yZevqiWPelIY X-Received: by 2002:a65:484c:: with SMTP id i12-v6mr11372245pgs.162.1526383184132; Tue, 15 May 2018 04:19:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526383184; cv=none; d=google.com; s=arc-20160816; b=ABl4iUUXI06UezR0rqOhvjKvqbHmTPjCkjOpYCyAMZXa3cxC858qXx0JIESl8hOzCe mUY6lEU48OUy1AoZNrFw9DBV2BXdthAFJNQ8rEPXRfivdtTOWaEx/Ag84ETZ5cwKi6op IA1zkXffa3Er3y981U+G1ncvHczpDsM87dE5u2+rUt9gbO9od1Y8wgoBU1ZLp4ngpeut ZLj72PLlzmu/i3uK7zh4uisYPaF0P9DWpG58QRBXVIEO18O+GuNV1Cqwg8KMDacEZZCf EGqz0npbzNJ7iQF/zays7tOUpK9Uwvz50Cq8hfoarO0qXnxDDB4gI1sXu3daT7yAgtiF a2Jg== 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=0iObrBuHpvzxli/QTXoepAQYSjSAB63UfqtWdYokcdo=; b=n9y0fXxFxdEBvjkKM+vGzJz6nwppcSVkgJ/JHa0V4Uq54WyR5v5OGv8z7zQWNL62Oc 7mzSk3sY/m0LrtwAl/wOYfV0uendDClX2Fm/X4JSUsa6Ew0pFXtj4GdSmBETA2vMBvQ5 B6609qoRAD7wjwowyJ2WrcehffcsnkEyWQMTWv9XJYPy8CuBIvt+qHJqv3Xs4RG2ldem Dt0y2UalbM26TJs+MUw+sXHUBZECd6vrFinhgTanNVNARvwCU19lCAFnGf0VT0l7/AJe YgoAH1CsKUpbYddiJWs/jlsQCGtJ0c9fNt3o1/pFAJQ8/YCYEHJLop/X+djFczoj6v1d gk6A== 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 r12-v6si11504023plo.442.2018.05.15.04.19.07; Tue, 15 May 2018 04:19:44 -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 S1752715AbeEOLR0 (ORCPT + 99 others); Tue, 15 May 2018 07:17:26 -0400 Received: from mail.bootlin.com ([62.4.15.54]:58012 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752323AbeEOLRY (ORCPT ); Tue, 15 May 2018 07:17:24 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 09B6420741; Tue, 15 May 2018 13:17:21 +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 D0FD5203B0; Tue, 15 May 2018 13:17:10 +0200 (CEST) Date: Tue, 15 May 2018 13:17:11 +0200 From: Maxime Ripard To: Hao Zhang Cc: Thierry Reding , robh+dt@kernel.org, Mark Rutland , linux@armlinux.org.uk, Chen-Yu Tsai , Claudiu Beznea , linux-gpio@vger.kernel.org, open list , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/Allwinner sunXi SoC support" , linux-pwm@vger.kernel.org, linux-sunxi@googlegroups.com Subject: Re: [PATCH v2 4/4] ARM: PWM: add allwinner sun8i pwm support. Message-ID: <20180515111711.l2g4vgsal7yr6dbr@flea> References: <20180225135308.GA14561@arx-s1> <20180226090038.etk5q4pd4rl5dvf6@flea.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gknln4zbx57iat3f" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --gknln4zbx57iat3f Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon, May 14, 2018 at 10:45:44PM +0800, Hao Zhang wrote: > 2018-02-26 17:00 GMT+08:00 Maxime Ripard : > > Thanks for respinning this serie. It looks mostly good, but you still > > have a quite significant number of checkpatch (--strict) warnings that > > you should address. >=20 > Thanks for reviews :) ,i'm sorry for that, it will be fixed next > time. and, besides, in what situation were the checkpatch warning > can be ignore=EF=BC=9F The only one that can be reasonably be ignored is the long line warning, and only if complying to the limit would make it less easy to understand. > > > > On Sun, Feb 25, 2018 at 09:53:08PM +0800, hao_zhang wrote: > >> +#define CAPTURE_IRQ_ENABLE_REG 0x0010 > >> +#define CFIE(ch) BIT(ch << 1 + 1) > >> +#define CRIE(ch) BIT(ch << 1) > > > > You should also put your argument between parentheses here (and in all > > your other macros). >=20 > Do you mean like this ? > #define CFIE(ch) BIT((ch) << 1 + 1) > #define CRIE(ch) BIT((ch) << 1) Yep, exactly. Otherwise, if you do something like CRIE(1 + 1), the result will be BIT(1 + 1 << 1), which will expand to 3, instead of 4. Also, CFIE looks a bit weird here, is it the offset that is incremented, or the value? You should probably have parentheses to make it explicit. > > > >> +static const u16 div_m_table[] =3D { > >> + 1, > >> + 2, > >> + 4, > >> + 8, > >> + 16, > >> + 32, > >> + 64, > >> + 128, > >> + 256 > >> +}; > > > > If this is just a power of two, you can use either the power of two / > > ilog2 to switch back and forth, instead of using that table. >=20 > I think using table is more explicit and extended... If you didn't have a simple mapping between the register values and the divider value, then yeah, sure. But it's not the case here. Thanks! Maxime --=20 Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com --gknln4zbx57iat3f Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlr6waEACgkQ0rTAlCFN r3RPFw/+JeurQEegEMeIm4JNTp7dnYT+zmfEGSK062yJIhYgiCXgWxxyqPd+2SnZ w0VoeGkC7ylD3R/5oRt5CCm2dce9JaOSJhYjRXU3zBsYicXQpWF0SgSgg8rfhmVb YFxPLqXYkW21szGXpufgx2en04pq9B1++FqbrgQzdKz4wc2UVGn9Ywz/se7FEDb1 ACqJyolA3e7XiFJv3jhtZimoHGr1MReBNgPiwS9sHrGweB03R/NUfeb04G9w/ARo 6DdeyHWjH+36TpZCzwMQPXwrqYpSjbFYEKf5vjVc2PB848+2h7p2vSmym/26vCkC xXvS/b/mNlp6EIEIWQs4ZdQKrYR4pCZq9M4WneBiLtVlq+ygiFn7uKeFGRjJukno iEiJrG3jOhnR2/37222rt/DZkb6oofJPtKyJadVwakQ3pFLeE8dB4a8xqsoHHoj1 aPMzZhovzRNkWRZoeffbegOEVTahVABjrEiHuQb+8NDYbpb137pEHWJTRiBUhV+4 h10Ez1d2OvugF7kZlkw2IVuzXdp4C5n3JMenTJ12el1JrjO7bfi+ddPVs3B/Iy7b CbPG/Ex+RAEULULg8dhpNmuweF5GN9pUlsAoxpPC/33Lg3Zx3AXyAdqWpjOLE0U7 nOsqUEPtnywqyu7xGwPFN8LDagoXEhXn1V8vVEQUm3KNpvlFxgs= =apZD -----END PGP SIGNATURE----- --gknln4zbx57iat3f--