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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0E92C433F5 for ; Tue, 29 Mar 2022 13:54:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237590AbiC2N4k (ORCPT ); Tue, 29 Mar 2022 09:56:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234222AbiC2N4g (ORCPT ); Tue, 29 Mar 2022 09:56:36 -0400 Received: from gateway31.websitewelcome.com (gateway31.websitewelcome.com [192.185.144.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 767771E3E33 for ; Tue, 29 Mar 2022 06:54:53 -0700 (PDT) Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 00D748A6CC for ; Tue, 29 Mar 2022 08:54:53 -0500 (CDT) Received: from 162-215-252-75.unifiedlayer.com ([208.91.199.152]) by cmsmtp with SMTP id ZCHEn8FVMHnotZCHEn1dRS; Tue, 29 Mar 2022 08:52:52 -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=R8VF1083Jml6bSlqQeVvGDZxIbXB4VClUDd8cNl8HqA=; b=ycg/a9dlJnrsrXw2QIi/hOynJz YapMKagNgi0vMp0GKaSr32e2PIXcmtWBEGCIkRUbEDIFRzkBAbqKOr9vwcCt/gwl2/RmYmxlbDwkc 9irvStDtwQR1PmxXGudquz6OypiepTQyImdwe86pa2qNZ+RBuuzFhvfjW8UYrAbVPqd0T9MNXdgU2 GsCNUaso2xsF8byuJGCZZ8Fu7zTMQHxp0LxKZ+T7dZRFOegM8Xv9lhn0dn2oyMuj+gfN5KuX2d71l /zHjs+zTOn4H2vXsh38qxOjPkyq6NOLnzP08v7IukXPeYIKRnd3vSoZ22hmGWKFxT6imnN4wfFsHq 9C00d64A==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:54542) 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 1nZCHD-00353G-Re; Tue, 29 Mar 2022 13:52:51 +0000 Message-ID: Date: Tue, 29 Mar 2022 06:52:50 -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: Michael Walle Cc: Andrew Lunn , Xu Yilun , Tom Rix , Jean Delvare , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Paolo Abeni , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org References: <20220328115226.3042322-1-michael@walle.cc> From: Guenter Roeck Subject: Re: [PATCH v1 0/2] hwmon: introduce hwmon_sanitize() 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: 1nZCHD-00353G-Re X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 108-223-40-66.lightspeed.sntcca.sbcglobal.net [108.223.40.66]:54542 X-Source-Auth: linux@roeck-us.net X-Email-Count: 8 X-Source-Cap: cm9lY2s7YWN0aXZzdG07YmgtMjUud2ViaG9zdGJveC5uZXQ= X-Local-Domain: yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/28/22 15:50, Michael Walle wrote: > Am 2022-03-28 18:27, schrieb Guenter Roeck: >> On 3/28/22 05:56, Andrew Lunn wrote: >>>> I'm not sure how to handle this correctly, as this touches both the >>>> network tree and the hwmon tree. Also, the GPY PHY temperature senors >>>> driver would use it. >>> >>> There are a few options: >>> >>> 1) Get the hwmon_sanitize_name() merged into hwmon, ask for a stable >>> branch, and get it merged into netdev net-next. >>> >>> 2) Have the hwmon maintainers ACK the change and agree that it can be >>> merged via netdev. >>> >>> Probably the second option is easiest, and since it is not touching >>> the core of hwmon, it is unlikely to cause merge conflicts. >>> >> >> No, it isn't the easiest solution because it also modifies a hwmon >> driver to use it. > > So that leaves us with option 1? The next version will contain the > additional patch which moves the hwmon_is_bad_char() from the include > to the core and make it private. That will then need an immutable > branch from netdev to get merged back into hwmon before that patch > can be applied, right? We can not control if someone else starts using the function before it is removed. As pointed out, the immutable branch needs to be from hwmon, and the patch to make hwmon_is_bad_char private can only be applied after all of its users are gone from the mainline kernel. I would actually suggest to allocate the new string as part of the function and have it return a pointer to a new string. Something like char *devm_hwmon_sanitize_name(struct device *dev, const char *name); and char *hwmon_sanitize_name(const char *name); because the string duplication is also part of all calling code. Guenter