Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp197135lfu; Wed, 30 Mar 2022 20:31:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsj2zJHjhr8Ezg2rZDSaWFdhbFHCYoizDQoqJ+IxxgE75mjnVRDzJRUx05vmhFvYJhae1Z X-Received: by 2002:a17:903:124a:b0:154:c7a4:9375 with SMTP id u10-20020a170903124a00b00154c7a49375mr2969206plh.0.1648697477693; Wed, 30 Mar 2022 20:31:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648697477; cv=none; d=google.com; s=arc-20160816; b=DIIad0JG5wCv2dA/hZgyoxcy2qGfwaqBjupi8PEvIr1I8Se6+mluRDWxbWxpTcifDy Pgw4ho6cEWE8NId44X4ZFUGwKT9JOINuNn9Zy11b3PhuS0xCHWPvsjfkkWAKwBjp7wzp jJyq4Nn1mHg9BqyRHU298KbeFWqMcR3PcB0k/XmOalNCu07T9iNrxB8dWaX3VsS6Xz3a jP/P0kgpg1ovgRg2wa8YoHQzS+0fj9h9WN2CtPzvEmYKlnNHzSpNqBIPiOLxQkVOT1MF 4awT0QQimQyekc7wX0lWAkwg8f14FMsrQjefKi7zPrYYtUmN5mPtNcPDiUpUp/6Htehj FeKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=0PR2zYdjHpnbzPpGDX73PfezrreUjmJPOTEhSKYO1Pw=; b=Y3pHW6lviUVW3h1p/ohLPrVgdtCf1j6iwNGO+YgHj6AuOfUaExeQCyJPaThaY4B4f8 qENk7XJjepLpjNC0S2dQ6X1li/MNLY72MuNHQanhaaiNX51y+TG8ZeTx12UkUNMoGj8w xziVG3X/DRo7jmcykaJAvKsu9k1bWgf2OsFvzc/XmocxD9jEkhKZudJLh8LslrhCYFZp urId3vMp9Ufu5VsTtIB+YwBPgXzV33Mv+e1FGwzf8NFIbqQtueLmcUJwcIvqi47oQcv+ 0XRYNidz+3WgoUDMhLdXqN2xeAv5araPqVFgajVpcLtd2y+MRz+WZyFYUo4/3ZAoxo/n Zf2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=aP7MVBYY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i5-20020a63cd05000000b003820502bd64si22358392pgg.231.2022.03.30.20.31.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 20:31:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=aP7MVBYY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C05B012298F; Wed, 30 Mar 2022 19:56:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229824AbiC3TnK (ORCPT + 99 others); Wed, 30 Mar 2022 15:43:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbiC3TnG (ORCPT ); Wed, 30 Mar 2022 15:43:06 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99B0613F5F; Wed, 30 Mar 2022 12:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc: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-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=0PR2zYdjHpnbzPpGDX73PfezrreUjmJPOTEhSKYO1Pw=; b=aP7MVBYYOC3fOr70nal+KO/51m fgs1qb4ZsYgXHfhoN5IOujYhXV8HWcqMADXtQLoZO8wpDxQqueubIhcTk1+HGj90A7mcMcxS8Z3ww f9EGTMCdpw4jZrLXAoG3bsz+Psqt1PfWmeEF/rWLvZV1V37RCkohiYgQaZGp+119J2IDuL13p9Nr9 msUyKTtnZNkgwYcE1IrvgOp1J34tP1nmWz2VhM+607A28flKZjhPm4+hu7q5Bet2u9gMH4kz/yriC EL7MSFc1LV28ceElh9CZwmjb2X7USUzKVHkwA1IX9Lm9WX8wqHZl4SHgu0JZG/zDErpNCsJ7hw4eo jpx6RMiA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:58030) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nZeBj-0003ek-2P; Wed, 30 Mar 2022 20:41:02 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nZeBf-0006uy-77; Wed, 30 Mar 2022 20:40:59 +0100 Date: Wed, 30 Mar 2022 20:40:59 +0100 From: "Russell King (Oracle)" To: Michael Walle Cc: Xu Yilun , Tom Rix , Jean Delvare , Guenter Roeck , 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 Subject: Re: [PATCH v2 3/5] net: sfp: use hwmon_sanitize_name() Message-ID: References: <20220329160730.3265481-1-michael@walle.cc> <20220329160730.3265481-4-michael@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220329160730.3265481-4-michael@walle.cc> Sender: Russell King (Oracle) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,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 Tue, Mar 29, 2022 at 06:07:28PM +0200, Michael Walle wrote: > Instead of open-coding the bad characters replacement in the hwmon name, > use the new hwmon_sanitize_name(). > > Signed-off-by: Michael Walle Assuming hwmon_sanitize_name() gets settled, then: Acked-by: Russell King (Oracle) > --- > drivers/net/phy/sfp.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c > index 4dfb79807823..0d5dba30444d 100644 > --- a/drivers/net/phy/sfp.c > +++ b/drivers/net/phy/sfp.c > @@ -1289,7 +1289,7 @@ static const struct hwmon_chip_info sfp_hwmon_chip_info = { > static void sfp_hwmon_probe(struct work_struct *work) > { > struct sfp *sfp = container_of(work, struct sfp, hwmon_probe.work); > - int err, i; > + int err; > > /* hwmon interface needs to access 16bit registers in atomic way to > * guarantee coherency of the diagnostic monitoring data. If it is not > @@ -1317,16 +1317,12 @@ static void sfp_hwmon_probe(struct work_struct *work) > return; > } > > - sfp->hwmon_name = kstrdup(dev_name(sfp->dev), GFP_KERNEL); > + sfp->hwmon_name = hwmon_sanitize_name(dev_name(sfp->dev)); > if (!sfp->hwmon_name) { > dev_err(sfp->dev, "out of memory for hwmon name\n"); > return; > } > > - for (i = 0; sfp->hwmon_name[i]; i++) > - if (hwmon_is_bad_char(sfp->hwmon_name[i])) > - sfp->hwmon_name[i] = '_'; > - > sfp->hwmon_dev = hwmon_device_register_with_info(sfp->dev, > sfp->hwmon_name, sfp, > &sfp_hwmon_chip_info, > -- > 2.30.2 > > -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!