Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp318588ybg; Wed, 18 Mar 2020 23:52:01 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuSIXsITrKtD68IhDCdwcnl9EcfI9d76RxMcEUzfXXpIx3bgUNL8mLU/Bqn2y1HDGZG0fhZ X-Received: by 2002:a54:4103:: with SMTP id l3mr1219347oic.84.1584600721364; Wed, 18 Mar 2020 23:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584600721; cv=none; d=google.com; s=arc-20160816; b=AVJx7rXfo/0OWONhy9Gr/MPI+UkJ+cxCO3xaCvg19ANn0FpKLTwgpJOGB9Oni3Dl/6 tzqJNw45qDoCeyvppYiOPuUvHIJRedc/DIfv0pHf4IBWxWq/LnI3wx56dcOHB8eiok3c eu29QGW0EcSev3KFHCocaJNfLKZFIVatXroho/Argj3+7IqDhpu5V6nVgxAJRhjceuhL qoVoPHoHgL24M6X+sz+pEdA7QrDeXi8SYhwp/5nkKoVQ5/ob+1/x6yhs8qGmsdGR7HaF HJetvoxKc1RzmD+9aP9gyIrzsZss6W+Iy1dRZRwlLh8QW2AfrNDZw93RsBTxICF8VYoL dHWA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=KmCbsXPwJ2tkaJLM+oqwVsYG5FPUeKmQxGASUfM2Y+k=; b=OuatI2WOI6Sz2GA+ZqZYkLwD6z/KNtH8wkEM1ZL+rrvoGxxS7foDEQXgxB42OcliTo VmmAaXek/K7A2QhhXDthTKttsavob3d5wGpwpp3MM1PA8FazezWadzQc7y9ae1jOhYoK REcflROQSGpK8CAzvqiIlM16OPgTMmytQnTz7LJfEadv75xvNrDxq7byqM+3vEAORfdV A/R8MpcMIjreydF7wFWQFb+D3JsdICCs8uXGK7iNNAfRZvbzTHpYfekCowcpqkYHa+fE pVRcess/N699k56vNW4n1rYrKUHgQlI+VQfY6ajIdNyjKTUooros2+Ov2MwVe9f/g/G1 +y4g== 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 w16si841830otl.217.2020.03.18.23.51.46; Wed, 18 Mar 2020 23:52:01 -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 S1727011AbgCSGvO (ORCPT + 99 others); Thu, 19 Mar 2020 02:51:14 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:57667 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726063AbgCSGvN (ORCPT ); Thu, 19 Mar 2020 02:51:13 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jEp0w-0005WC-FG; Thu, 19 Mar 2020 07:50:46 +0100 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1jEp0p-0002ri-RB; Thu, 19 Mar 2020 07:50:39 +0100 Date: Thu, 19 Mar 2020 07:50:39 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Thierry Reding Cc: Oleksandr Suvorov , devicetree@vger.kernel.org, linux-pwm@vger.kernel.org, Paul Barker , Laurent Pinchart , Marcel Ziswiler , Igor Opaniuk , Philippe Schenker , Alexandre Belloni , Chen-Yu Tsai , Claudiu Beznea , Fabio Estevam , Florian Fainelli , Heiko Stuebner , Kevin Hilman , Ludovic Desroches , Maxime Ripard , NXP Linux Team , Nicolas Ferre , Palmer Dabbelt , Paul Cercueil , Paul Walmsley , Pengutronix Kernel Team , Ray Jui , Sascha Hauer , Scott Branden , Shawn Guo , bcm-kernel-feedback-list@broadcom.com, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: Re: [RFC PATCH 1/7] pwm: rename the PWM_POLARITY_INVERSED enum Message-ID: <20200319065039.szhh5dm6v3ejwijd@pengutronix.de> References: <20200317123231.2843297-1-oleksandr.suvorov@toradex.com> <20200317123231.2843297-2-oleksandr.suvorov@toradex.com> <20200317174043.GA1464607@ulmo> <20200317210042.ryrof3amr7fxp4w5@pengutronix.de> <20200318225953.GA2874972@ulmo> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200318225953.GA2874972@ulmo> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [Dropped Tony Prisk from recipients as the address bounces] Hello, On Wed, Mar 18, 2020 at 11:59:53PM +0100, Thierry Reding wrote: > On Tue, Mar 17, 2020 at 10:00:42PM +0100, Uwe Kleine-K?nig wrote: > > Hello, > > > > 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. > > > > > > It isn't misspelled. "inversed" is a synonym for "inverted". Both > > > spellings are correct. > > > > 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: > > > > https://www.lexico.com/search?utf8=%E2%9C%93&filter=dictionary&dictionary=en&query=inversed > > https://de.pons.com/%C3%BCbersetzung/englisch-deutsch/inversed > > https://dictionary.cambridge.org/spellcheck/english-german/?q=inversed > > > > 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 There is something fishy. In the Verb section it says indeed, that it is the past participle and simple past of inverse. The entry for inverse however only has sections that identify this word as adjective or noun; not a verb. > https://www.dictionary.com/browse/inversed Not sure I'd count this as hint that inversed exists. The entry shown to me under this URL is about "inverse" and it has verb (used with object), in?versed, in?vers?ing. ? to invert. Does this mean: "Did you mean invert instead?" > https://en.wiktionary.org/wiki/inversed Yeah, that's the one I found, too. I still have the impression that "inversed" is in use because people don't know better and understand the intended meaning. And this results in leaking of this word into the references. > > 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. In literature yes, I agree. In a novel it is annoying to repeat the same words over and over again and some variation is good. In programming however the goal is a different one. There the goal should be to be precise and consistent. > > > 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. > > > > 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. I admit I didn't look closely here and I assume you are right. If I understand Oleksandr right this is only an intermediate step and when the series is applied completely this issue is gone. Still it might be worth to improve the series here. My original question was about similar problems with GPIO_ACTIVE_HIGH. Are you aware of problems there? > > > 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. > > > > 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. We disagree here. With this argument you could fix quite some things as ABI. > 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. Oleksandr adapted all in-tree users, so it only affects out-of-tree users. In my book this is fine. > Why bother? To make the API more precise and consistent. That's a good goal in my eyes. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | https://www.pengutronix.de/ |