Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp936104pxb; Thu, 31 Mar 2022 23:33:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyM+0nXAJZMXz2jzq0vRt5e6ovxuXOTs9wHBXJRklBifSGqOwu7imug9YPdckKIhMU1W0fG X-Received: by 2002:a17:907:a414:b0:6e0:68f3:d7a with SMTP id sg20-20020a170907a41400b006e068f30d7amr2034371ejc.75.1648794788026; Thu, 31 Mar 2022 23:33:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648794788; cv=none; d=google.com; s=arc-20160816; b=XE3Mv8y+yemMziphCtF1myWjvOxE7XjcqSQ1XlTQx9sI/QrCMrzjicdRgO/jE9pAHx kiEvM1SLgeY5UTTNxuz43vdOV9RfT4FXIZ2zm4bgKh7QDykhkyZWz9hwpXPtdqNiK86S ozud/g3Jbo5QLrXZVeegrmUG4mpwOrZC7qVIuue09a9dIQ7O1ES+vTeyF3XvTzUlD3Hr 4+wRu6HQLCUyS7DIQD95nCFWeyf7E4Zae9V1YN4gaMVOPSuFDWrHu4bo9pMVY0YtuS4I Kssx9V2KdUSeW5xsuiY1hlqxX3oYjVyCKUmlPiFXze52DIai03vfqKXtZeovv/SOvpmS c/yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=aI+bV8VGhtRiaWJK4Xog9eYqwu1fuRPuRDubJJk73ag=; b=EY986+EYe+yZCwGC1/41tFweLlw/kPmzzp5G1efQcUhcHFDU8ZeJ8ccCsxGOkjrOXA kaxuE+zhG+XtI9eFIZ8Ok6iBspk0A1xKdO0+nS/8viopuvbTplxDR6gWiR1/omLAwCtN aEomHoqsd5YqMOlcVE01aYzKBSC2VL9d/kPJGT9jVmeuMU+GA2517vkmIO+8i3lY/z29 aAgWCdcxRqXDR0Kf8XmORequU8EermIZYrnCCyc8sKhPYVAYgTpgte4Ybkxq1z9/oixx +jzN2uNeqam2s40gsW/uSX4mHPpTtAiTtbsa5gjd0ogcUZgcKYF2CJ7ccM+FrYnMNeJo 7mDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@roeck-us.net header.s=default header.b=c0sezV+T; 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 s2-20020a170906284200b006dfcc69b3a2si1012195ejc.67.2022.03.31.23.32.32; Thu, 31 Mar 2022 23:33:07 -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; dkim=fail header.i=@roeck-us.net header.s=default header.b=c0sezV+T; 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 S234396AbiCaRNS (ORCPT + 99 others); Thu, 31 Mar 2022 13:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234323AbiCaRNO (ORCPT ); Thu, 31 Mar 2022 13:13:14 -0400 Received: from gateway24.websitewelcome.com (gateway24.websitewelcome.com [192.185.50.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48F601F0824 for ; Thu, 31 Mar 2022 10:11:26 -0700 (PDT) Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway24.websitewelcome.com (Postfix) with ESMTP id AF29A964A4 for ; Thu, 31 Mar 2022 12:11:25 -0500 (CDT) Received: from 162-215-252-75.unifiedlayer.com ([208.91.199.152]) by cmsmtp with SMTP id ZyKTn4xcGdx86ZyKTncJZ0; Thu, 31 Mar 2022 12:11:25 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:Subject:From:References:Cc:To:MIME-Version:Date:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=aI+bV8VGhtRiaWJK4Xog9eYqwu1fuRPuRDubJJk73ag=; b=c0sezV+TbXC1QwszWGrATQAgiE 0jgkWUUd6BbxqDO+EjXgTMimyq86tP0QHgrkwh/fdgv2dcoCizLW9iQY3UjATcpTyQGemT1pF/nnX tbRNrf86txWyX+N4V/p5CVbqCC0ShTYTKybgmUM18V2HM3cUIOpmHsTs28WbH8IFCv4KEkYOUlJZf RdRTlWgP6Ouq75QBvgVEZuftBnRcyOa3uTIweNHxc866NyynaZOJZYEg3GCDT27yQyHipY/pR5jWM +xFR+50w4G4UxqwHji7U57A8oTvRngZH8DD9sf46URRBQbi+iRz/h4RRPZYRhlJmTQ4xGihNjlE/W IWfLcSrw==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:54590) by bh-25.webhostbox.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nZyKS-002ePL-N9; Thu, 31 Mar 2022 17:11:24 +0000 Message-ID: <68f0b4b6-59ed-34ac-bc69-810668a979de@roeck-us.net> Date: Thu, 31 Mar 2022 10:11:22 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US To: "Russell King (Oracle)" , Michael Walle Cc: Xu Yilun , David Laight , Tom Rix , Jean Delvare , Andrew Lunn , Heiner Kallweit , "David S . Miller" , Jakub Kicinski , Paolo Abeni , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org References: <20220329160730.3265481-1-michael@walle.cc> <20220329160730.3265481-2-michael@walle.cc> <20220330065047.GA212503@yilunxu-OptiPlex-7050> <5029cf18c9df4fab96af13c857d2e0ef@AcuMS.aculab.com> <20220330145137.GA214615@yilunxu-OptiPlex-7050> <4973276f-ed1e-c4ed-18f9-e8078c13f81a@roeck-us.net> <7b3edeabb66e50825cc42ca1edf86bb7@walle.cc> From: Guenter Roeck Subject: Re: [PATCH v2 1/5] hwmon: introduce hwmon_sanitize_name() In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-BWhitelist: no X-Source-IP: 108.223.40.66 X-Source-L: No X-Exim-ID: 1nZyKS-002ePL-N9 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 108-223-40-66.lightspeed.sntcca.sbcglobal.net [108.223.40.66]:54590 X-Source-Auth: linux@roeck-us.net X-Email-Count: 2 X-Source-Cap: cm9lY2s7YWN0aXZzdG07YmgtMjUud2ViaG9zdGJveC5uZXQ= X-Local-Domain: yes X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 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 3/31/22 07:58, Russell King (Oracle) wrote: > On Thu, Mar 31, 2022 at 04:51:47PM +0200, Michael Walle wrote: >> Am 2022-03-31 16:45, schrieb Russell King (Oracle): >>> On Wed, Mar 30, 2022 at 08:23:35AM -0700, Guenter Roeck wrote: >>>> Michael, let's just drop the changes outside drivers/hwmon from >>>> the series, and let's keep hwmon_is_bad_char() in the include file. >>>> Let's just document it, explaining its use case. >>> >>> Why? There hasn't been any objection to the change. All the discussion >>> seems to be around the new function (this patch) rather than the actual >>> conversions in drivers. >>> >>> I'm entirely in favour of cleaning this up - it irks me that we're doing >>> exactly the same cleanup everywhere we have a hwmon. >>> >>> At the very least, I would be completely in favour of keeping the >>> changes in the sfp and phy code. >> >> FWIW, my plan was to send the hwmon patches first, by then my other >> series (the polynomial_calc() one) will also be ready to be picked. >> Then I'd ask Guenter for a stable branch with these two series which >> hopefully get merged into net-next. Then I can repost the missing >> patches on net-next along with the new sensors support for the GPY >> and LAN8814 PHYs. > > Okay, that's fine. It just sounded like the conversion of other drivers > outside drivers/hwmon was being dropped. > Not dropped, just disconnected. From hwmon perspective, we want a certain set of characters to be dropped or replaced. Also, from hwmon perspective, it makes sense to have the helper function allocate the replacement data. There was disagreement about which characters should be replaced, and if the helper function should allocate the replacement string or not. I have no intention to change the set of characters without good reason, and I feel quite strongly about allocating the replacement in the helper function. Since potential callers don't _have_ to use the helper and don't _have_ to provide valid names (and are responsible for the consequences), I would like that discussion to be separate from hwmon changes. > Note that there's another "sanitisation" of hwmon names in > drivers/net/phy/marvell.c - that converts any non-alnum character to > an underscore. Not sure why the different approach was chosen there. > It actually drops non-alphanumeric characters. The name is derived from the phy device name, which I think is derived from the name field in struct phy_driver. That includes spaces and '(', ')'. I honestly have no idea what libsensors would do with '(' and ')'. Either case, even if that would create a hiccup in libsensors and we would add '(' and ')' to the 'forbidden' list of characters, the fact that the code doesn't replace but drop non-alphanumeric characters means it won't be able to use a helper anyway since that would result in a hwmon 'name' attribute change and thus not be backward compatible. Besides, "Marvell_88E1111__Finisar_" would look a bit odd anyway, and "Marvell88E1111Finisar" may be at least slightly better. Guenter