Received: by 10.192.165.148 with SMTP id m20csp1012473imm; Thu, 10 May 2018 04:21:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrenoRVQiZ02N6RB5KR6LyfbM5nTdWbPa24jU9ps2NJHx3hXOnQOtlHWh0xJg/H6GjvW5rT X-Received: by 2002:a63:6142:: with SMTP id v63-v6mr825174pgb.432.1525951293428; Thu, 10 May 2018 04:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525951293; cv=none; d=google.com; s=arc-20160816; b=VHldPgkRPhsghG/xDRSNi5L2A1uKFbTWQNCg83OxdxUMJwjJkWeVVriXh7iwU5uqQT Q4M9uvIuYMLJrNIjLHAfIDNvDSc1RQHG8X87ex0h8F8LyRJMPsNdRcn5dmV874Y04AzR fGTUEvaFHQRFIaBC3AGXmHyuBUxW8m8fTnIW/aPL5Qehrpro65fRXgNVKm2C74eDBbjp 574G5ErDpVMw018xh1p8yVlckqe/SCwTcItFPg2uuwKgOZAbvA1SRqIwLVVjNxY35OFX 9eBqE0V9xzX6Kk1XfbykI/X3VvektsuSIACxSq7rFK7IeRtDK+nOtiq9T4tlLmFsc2om 69zA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=tiMj3ExrS0eJ1gG3DGvbxeEca8V54KYQse71U3SSeWE=; b=h1jAoHTetv7bW7wF3Hb8Fs641ulgs+EWN+gunusZbRKtvc0rfWKtduFgKIUejU7zzW 3q9jxYstjot3k9RlIUdZvZNImQClyOrmZO/BC7Qu1eipbTj8pckZRCFJJBNOXhVdXOj+ w6V/B2v5Xc6HE9D0oUe8j6uwlCWse7l/Y6y7V/N8+d4FCg32ZOBv4vz3voebKE8TQu7H 2L+ZjYIy0xFqqSCrJFZwtRBIjmBdT3uTMVKZjLg9vzSzvLFwyJjiEGWVlEHfThEQKV/E EvqEThJ55F5SOUQbxlXcm73o34rhfodCfANRLQZNOMrEXd9Y+gZFquqBqRJZCqC9JEnz YxDA== 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 a5-v6si652611pla.117.2018.05.10.04.21.18; Thu, 10 May 2018 04:21:33 -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 S935365AbeEJLVF (ORCPT + 99 others); Thu, 10 May 2018 07:21:05 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:57975 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934002AbeEJLVE (ORCPT ); Thu, 10 May 2018 07:21:04 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 6383B8022D; Thu, 10 May 2018 13:21:02 +0200 (CEST) Date: Thu, 10 May 2018 13:21:01 +0200 From: Pavel Machek To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Greg Kroah-Hartman , Jiri Slaby , Johan Hovold , Jacek Anaszewski , linux-serial@vger.kernel.org, linux-leds@vger.kernel.org, linux-can@vger.kernel.org, kernel@pengutronix.de, One Thousand Gnomes , Florian Fainelli , Mathieu Poirier , linux-kernel@vger.kernel.org, Robin Murphy , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 1/3] leds: triggers: provide led_trigger_register_format() Message-ID: <20180510112101.GD6977@amd> References: <20180508100543.12559-1-u.kleine-koenig@pengutronix.de> <20180508100543.12559-2-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3Pql8miugIZX0722" Content-Disposition: inline In-Reply-To: <20180508100543.12559-2-u.kleine-koenig@pengutronix.de> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --3Pql8miugIZX0722 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > This allows one to simplify drivers that provide a trigger with a > non-constant name (e.g. one trigger per device with the trigger name > depending on the device's name). >=20 > Internally the memory the name member of struct led_trigger points to > now always allocated dynamically instead of just taken from the caller. >=20 > The function led_trigger_rename_static() must be changed accordingly and > was renamed to led_trigger_rename() for consistency, with the only user > adapted. Well, I'm not sure if we want to have _that_ many trigger. Trigger interface is going to become.. "interesting". We have 4K limit on total number of triggers. We use rather strange interface to select trigger. > @@ -115,13 +115,13 @@ static int can_led_notifier(struct notifier_block *= nb, unsigned long msg, > =20 > if (msg =3D=3D NETDEV_CHANGENAME) { > snprintf(name, sizeof(name), "%s-tx", netdev->name); > - led_trigger_rename_static(name, priv->tx_led_trig); > + led_trigger_rename(priv->tx_led_trig, name); > =20 > snprintf(name, sizeof(name), "%s-rx", netdev->name); > - led_trigger_rename_static(name, priv->rx_led_trig); > + led_trigger_rename(priv->rx_led_trig, name); > =20 > snprintf(name, sizeof(name), "%s-rxtx", netdev->name); > - led_trigger_rename_static(name, priv->rxtx_led_trig); > + led_trigger_rename(priv->rxtx_led_trig, name); > } > =20 I know this is not your fault, but if you have a space or "[]" in netdev names, confusing things will happen. I believe we should have triggers "net-rx, net-tx" and it should have parameter "which device it acts on".=20 Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --3Pql8miugIZX0722 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlr0Kx0ACgkQMOfwapXb+vLW1QCgnozST91ktpRM+xqluM5IlXl3 vRIAoJ2T07nh8amp5NEYb4mjacqZSeYx =mG9E -----END PGP SIGNATURE----- --3Pql8miugIZX0722--