From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0A90C4332D for ; Wed, 18 Mar 2020 23:00:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 637992076C for ; Wed, 18 Mar 2020 23:00:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IXRxBs/F"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RtTb+Z6Q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 637992076C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nmj9uv8JjroCxLd2/hKbK0lplAnT2mRr6A54sT1xCHQ=; b=IXRxBs/FkYdpCKyzmQh7lNdNH jwfHDAYFNSBGqdd4O4+juIao3eQ7+DMrQDWsXc5dWujSRe8z50l6+Hmgd36DrgThiEluGpl4CRwHL AlUzp7yJu8b92Ww5sh4Mzaa5VVwnPmBv5WnSPHp5Imqxajqfq/vzCEZi9oaviMyM3B1bUQGAHmTZ5 g3a/F2slGseE8NxHBkWkNzplH+5M7qXlVoYSPfGXqS8/RyLDVB/aKSx+7QokT2/FgMfBONvZrEUs8 aVX7AM5SLLPpbBmhIpZS0FFazpGHabi9E5E3noo8xiLWfmm3HYwJ4sS6zDwyvpZuJqBajMPSAtt3e htZaKfl+g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jEhfR-0006Kl-AG; Wed, 18 Mar 2020 23:00:05 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jEhfK-00068Z-4b; Wed, 18 Mar 2020 22:59:59 +0000 Received: by mail-wm1-x343.google.com with SMTP id 11so50315wmo.2; Wed, 18 Mar 2020 15:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FhuQwfPEL0hTgcoNyTMHnKuBvWWB7/uRwTo4pXti+54=; b=RtTb+Z6QgPX6eEk3FcD1grGQYUCvruM8UTymlZC+u2AS/kHOQJyaFhItAwOgTYJ4Iq 2mlLnLpKFkKYxeEa6ik/FHG5WgomIPKzWJCpXWwx/WMbz3DLkEucM3dI8iUjjZ0VxU05 SiEE+A9lLPeHd144Ji0pRRBVEzBKNYNjbsvNsWibxVIzRwfFqOwaODGCw/eACtav54NZ 9UMX0klApRPIBsexNFl7f7xe+WV9lBonnFHUzPBm7JTP08qHOF/GK4CdbGsdYJhHw1zD GuzJeFFGYqihD8KEpnv+SZAwgYDSNxNDFxq2citLe9Gsg4AM87C11YTFIMYYpjtY7dke jltw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FhuQwfPEL0hTgcoNyTMHnKuBvWWB7/uRwTo4pXti+54=; b=ocyx0lXRhEAeiVFfZS/6XtHrnKPkTZLrFTaPfzpv+BixANoAFmxm+j0qCMpmUd6oDT ZBbUjsKUBJiv+KEQ1VDUP/vv/M1hwrL12VNqiiDRy6Rqsp7QFYZwrj3X1HH0XnsBEX63 e5IXnRF5h5Qwm2N0damWsUaPL6VC6GI88n91pCOegnW0RHjXDursN8o3XJPH8uXTxPLk FwEdmTgTZAsjo0zvSWisJz0x18P3yYxUQUVxxB6PybGDtBehk3fmdcAXsRVJTpjUPYUx Kcmufpkyo0lk8LdB2OfgpAdqKKS+R/ekT0KeDAGntvYIrlpANBbF2TIRtPa4mhvSQwFE t9UA== X-Gm-Message-State: ANhLgQ3aAY+G5E6E/Wbi1GYYvkE3Jq4No5WBqrLjHnSYN9Nodte4Q1xc 64GS5BX/bVVmF8Hz3cKhneE= X-Google-Smtp-Source: ADFU+vu7WgNjakSl0C5AyVxj/dSWix5Gir8iXHudP3rtR2SXhkPxNUW8q0N0umVfG+eC8fRj1pA40A== X-Received: by 2002:a1c:b60b:: with SMTP id g11mr7888357wmf.175.1584572395964; Wed, 18 Mar 2020 15:59:55 -0700 (PDT) Received: from localhost (pD9E516A9.dip0.t-ipconnect.de. [217.229.22.169]) by smtp.gmail.com with ESMTPSA id q72sm353382wme.31.2020.03.18.15.59.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2020 15:59:54 -0700 (PDT) Date: Wed, 18 Mar 2020 23:59:53 +0100 From: Thierry Reding To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= Subject: Re: [RFC PATCH 1/7] pwm: rename the PWM_POLARITY_INVERSED enum Message-ID: <20200318225953.GA2874972@ulmo> References: <20200317123231.2843297-1-oleksandr.suvorov@toradex.com> <20200317123231.2843297-2-oleksandr.suvorov@toradex.com> <20200317174043.GA1464607@ulmo> <20200317210042.ryrof3amr7fxp4w5@pengutronix.de> MIME-Version: 1.0 In-Reply-To: <20200317210042.ryrof3amr7fxp4w5@pengutronix.de> User-Agent: Mutt/1.13.1 (2019-12-14) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200318_155958_215008_270C4284 X-CRM114-Status: GOOD ( 27.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Heiko Stuebner , linux-pwm@vger.kernel.org, Marcel Ziswiler , linux-kernel@vger.kernel.org, Oleksandr Suvorov , Laurent Pinchart , linux-riscv@lists.infradead.org, Fabio Estevam , Florian Fainelli , Kevin Hilman , Chen-Yu Tsai , linux-rockchip@lists.infradead.org, Ludovic Desroches , bcm-kernel-feedback-list@broadcom.com, NXP Linux Team , devicetree@vger.kernel.org, Ray Jui , Sascha Hauer , Maxime Ripard , Philippe Schenker , Paul Barker , Paul Walmsley , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Paul Cercueil , Igor Opaniuk , Scott Branden , Tony Prisk , Palmer Dabbelt , Pengutronix Kernel Team , Shawn Guo , Claudiu Beznea Content-Type: multipart/mixed; boundary="===============4124389077041648156==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4124389077041648156== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ReaqsoxgOBHFXBhH" Content-Disposition: inline --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 17, 2020 at 10:00:42PM +0100, Uwe Kleine-K=C3=B6nig wrote: > Hello, >=20 > On Tue, Mar 17, 2020 at 06:40:43PM +0100, Thierry Reding wrote: > > On Tue, Mar 17, 2020 at 02:32:25PM +0200, Oleksandr Suvorov wrote: > > > The polarity enum definition PWM_POLARITY_INVERSED is misspelled. > > > Rename it to PWM_POLARITY_INVERTED. > >=20 > > It isn't misspelled. "inversed" is a synonym for "inverted". Both > > spellings are correct. >=20 > Some time ago I stumbled about "inversed", too. My spell checker doesn't > know it and I checked some dictionaries and none of them knew that word: >=20 > https://www.lexico.com/search?utf8=3D%E2%9C%93&filter=3Ddictionary&dictio= nary=3Den&query=3Dinversed > https://de.pons.com/%C3%BCbersetzung/englisch-deutsch/inversed > https://dictionary.cambridge.org/spellcheck/english-german/?q=3Dinversed >=20 > https://en.wiktionary.org/wiki/inverse#Verb mentions "inverse" as a verb > having "inversed" as past participle. Here are the first three results from a Google query: https://www.yourdictionary.com/inversed https://www.dictionary.com/browse/inversed https://en.wiktionary.org/wiki/inversed > Having said this I think (independent of the question if "inversed" > exists) using two similar terms for the same thing just results in > confusion. I hit that in the past already and I like it being addressed. I don't know. It's pretty common to use different words for the same thing. They're called synonyms. > > And as you noted in the cover letter, there's a conflict between the > > macro defined in dt-bindings/pwm/pwm.txt. If they end up being included > > in the wrong order you'll get a compile error. >=20 > There are also other symbols that exist twice (GPIO_ACTIVE_HIGH was the > first to come to my mind). I'm not aware of any problems related to > these. What am I missing? There's currently no problem, obviously. But if for some reason the include files end up being included in a different order (i.e. the dt-bindings header is included before linux/pwm.h) then the macro will be evaluated and result in something like: enum pwm_polarity { PWM_POLARITY_NORMAL, 1, }; and that's not valid C, so will cause a build error. > > The enum was named this way on purpose to make it separate from the > > definition for the DT bindings. >=20 > Then please let's make it different by picking a different prefix or > something like that. Again, seems to me like unnecessary churn. Feel free to propose something, but I recall being in the same position at the time and this was the best I could come up with. > > Note that DT bindings are an ABI and can > > never change, whereas the enum pwm_polarity is part of a Linux internal > > API and doesn't have the same restrictions as an ABI. >=20 > I thought only binary device trees (dtb) are supposed to be ABI. Yes, the DTB is the ABI. dt-bindings/pwm/pwm.h is used to generate DTBs, which basically makes it ABI as well. Yes, the symbol name may not be part of the ABI, but changing the symbol becomes very inconvenient because everyone that depends on it would have to change. Why bother? My point is that enum pwm_polarity is an API in the kernel and hence its easy to change or extend. But since that is not the same for the DTB, we need to be careful what from the internal kernel API leaks into the DTB. That's why they are different symbols, so that it is clear that what's in dt-bindings/pwm/pwm.h is the ABI. Thierry --ReaqsoxgOBHFXBhH Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAl5yp+UACgkQ3SOs138+ s6FO/BAApA+hyvKBdtCzUbodbVNOnFlAivhVCo+N5zGSec6fjuALlAnGB/kYeWlt XpSwooECx8G2j+mO9LmKjQi4ZmZxFGhO790xo3Q4CHNE+c/DNU0iP3cTXlJYhrAm fBpMAsDBwuyrcJCuavVIDuM0okLAQ2XlmZFFT3WNCuC7NmmwkvVr0lJeg1/9lIsp mivS6EuLEwXH0H03avpu3+o6+RAIKdO7jKegMHGQNWnBNg1bj+dCMvnKrxAKEjby 27HuFhm4cMsd5DQQE2RlB7iWZD1aLpk/S7n98LvGti8PiXAtfVzPjUhIXFrvJXi/ 3A7ZwL7jHyaCmMMD3BJHa3/f3SlJMPU31ABixFS4R1t8LyLW4yw47jvZeznRqy8m 4EkQcdl5EQ4bdDyVOgyWTJTjuPLqahDFFjZGapLbvpM6nj9FTAX+PTDhAvi+QQ4F XYkRpbO23Vw9bkE5hHNnD1lYMUgBE0WYTYZVgxEhVbV8Tte3qvnidjlEiNdVFznM uYBZv0Ks0r5LAWq2EAwy6JlfzbfdP42dlj5ZRgqNqhTbybFhtwpZ1qhE/XfG0k4L gfJt9ZXUHn81TWBrKoUC3YNbjJtTF2cl7l2JKft6+S3W93CV50lTzycJp/iy3srI qigCThG2YlpsInS8ZEfww4p47i5+Uje0uHDaoT07uEukyjNAYkQ= =Nsfz -----END PGP SIGNATURE----- --ReaqsoxgOBHFXBhH-- --===============4124389077041648156== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============4124389077041648156==--