Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2248907rwe; Sun, 28 Aug 2022 07:05:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR7/zWmYw8KuIpLdl0TvEhSaCmDZNaUfBVkm8iZvMI3nDXlFfx80oH0dbMaNr5ovu3+NkUEJ X-Received: by 2002:a17:907:970c:b0:741:748b:6dac with SMTP id jg12-20020a170907970c00b00741748b6dacmr1753478ejc.479.1661695529806; Sun, 28 Aug 2022 07:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661695529; cv=none; d=google.com; s=arc-20160816; b=i3hoUXFoYxReVAAQKfpZ5wBBIbu27CSciJw2vshFIpTmv+ssyxCf/C4WTgvPzNc6FN Hnu0EPPiz/04MFYOEzo0l5tG3KlC9bpWDDZcPnbbL0LnQMHpyhJHBFYeF7Y05At7dfq4 PXHj4dz5dVTV3OEKfbzcHzlwwOZRDm2xTNgwmrdX49gXxY9eVGZfOpDvwB60AJVYcfg3 bDEk+R/scSCveCJ8j0p0wXrkklZ5I5zHexacf6LGdXQeA0JgLTnQRmdlsDQF8pJ+XooS 9rgb+RTzjLS/Upk6gHDjabXLFqm7bK0B+zg47RhbvRXIxnChzyoFJDAhyZmBvEoy646W 0cZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=oqzlvkurbMBmmXzabDJ1WiFjGo4Q3V33ud9ahn48xfY=; b=TPcljTru3OVdkPGC6lVC1UzSpwb1gYsIEJdPlLhvp7T/yCnrUeNBa/lC7uYPum+1Fk 15+j4N4+9WD8of4KAY1F5ao3NW8G5oli9azva4O3dDeghvxhDacCLjD7RhBPBf1H/4uV wZVmTgawC26a6SY1zV8WtyzApktf+xw0veek8XhmnGcgnBylOo2vtJ1+He1FGXIMIaLX 4wVQ0aPEcvd1sQ73uzxs6ZJhRr6Tvh2/OJAL7wcc9zOlvYZij5h36yaOuys8N2+3Cne/ asdFMOxOr+oEg32akB2gh+3/Pvc3Z+4c9QkPBZKgoDH5TSQfERlD4dXMiztkpbdMEwW5 093g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w2-20020a17090652c200b0072b11a2a2afsi4691959ejn.57.2022.08.28.07.04.49; Sun, 28 Aug 2022 07:05:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229541AbiH1NqX convert rfc822-to-8bit (ORCPT + 99 others); Sun, 28 Aug 2022 09:46:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbiH1NqW (ORCPT ); Sun, 28 Aug 2022 09:46:22 -0400 Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A8572CE12; Sun, 28 Aug 2022 06:46:17 -0700 (PDT) Received: from omf20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6C53CAB493; Sun, 28 Aug 2022 13:46:16 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf20.hostedemail.com (Postfix) with ESMTPA id 3DEF520025; Sun, 28 Aug 2022 13:46:15 +0000 (UTC) Message-ID: <2e158f8dc433b6b78d47d209495bed678d92369a.camel@perches.com> Subject: Re: [PATCH v2 4/4] pwm: sysfs: Utilize an array for polarity strings From: Joe Perches To: Andy Shevchenko Cc: Andy Shevchenko , "linux-pwm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Thierry Reding , Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= Date: Sun, 28 Aug 2022 09:46:14 -0400 In-Reply-To: References: <20220826170716.6886-1-andriy.shevchenko@linux.intel.com> <20220826170716.6886-4-andriy.shevchenko@linux.intel.com> <5ba98dbd91dc981ec7384484b2a498805abef6b0.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) MIME-Version: 1.0 X-Rspamd-Queue-Id: 3DEF520025 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Stat-Signature: 76zegqeqc9tix8aj9gskfzf6b7iatym8 X-Rspamd-Server: rspamout01 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX188JZ8rGYJxzNHOxcSKe4yGHz+58IHEFbA= X-HE-Tag: 1661694375-255221 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2022-08-28 at 09:40 +0300, Andy Shevchenko wrote: > On Sunday, August 28, 2022, Joe Perches wrote: > > > On Fri, 2022-08-26 at 20:07 +0300, Andy Shevchenko wrote: > > > Code is smaller and looks nicer if we combine polarity strings > > > into an array. > > First of all, please remove unnecessary context when replying. I am _very_ aware of context. I specifically left the code in. > > It's less robust though as PWM_POLARITY_NORMAL and _INVERSED > > are now required to be 0 and 1. As the only 2 values in > > an enum they are, but that's not really guaranteed unless > > you read the enum definition. > > So, what do you suggest here and in many other similar places (yes, ABI > implied) in the kernel? Leaving the code alone.