Received: by 10.192.165.148 with SMTP id m20csp1015423imm; Thu, 10 May 2018 04:24:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrZ712BL8cy6haa1xfTnDqEwPoFJKoyWnwV+DTOPxOlkK2mizcqaKi2fOvtrj6Q3TS92FZX X-Received: by 2002:a63:b70b:: with SMTP id t11-v6mr816136pgf.390.1525951458381; Thu, 10 May 2018 04:24:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525951458; cv=none; d=google.com; s=arc-20160816; b=YocaQ/IbGZoEAXjJOX+mzExXiBfJgFpoMo3/akT7vVk+BkNAryPdNx+gMMYwttHpB8 3TsymqfPpntHdQrtd2jLaQ7WLcRzxMKX8/Tw3FBrqq7XreF5SCaYmQ9GuD8EN/rcBVK9 aSSVxUfiI3/sRSbykKzAu5pL0Iy90YJrR6N5OrGpJVPsclbsrVJbZXkM5YY0xOl+Xfgw QSU+Re88B+bnQbPmFflFcDZtnxJlv473nn0Li2+zJa9wlAqXRA3uNTQJ15MwBTD6B0iL E8dcB9UDCybc5jySno5gtHgltgMTLtE4pm5miaU5zMah/LssVEWaI5nC7MBKRy9cIFTj zCEQ== 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=6zahiYvOvCAfWsMkEep4zoJpacK2t9sf2iNJFUe+aok=; b=gEQPKUIb4vZ/TX7kl2u4Fa5Ta2MoQ2oHW9UFNN2yjntHmdYhwn2h6hmwNla82YcgCQ P4QihZczsmhJi0w+QVc45y1/ErjeEvFrWmw9cjUesyrDXaLWN64OP2gXBRkT7vTB14uk 1mTAE/Imz4865wyYr9ocnagtze0YhFz2wLecnchbcK3XTISKLhEAB0zhBj75727nmqUI SWiYjSRZGnNLLnxBnBC5knrpyRI9qgRBP8qc8cyU9Za0De0Rh9K0vIxDiqkzwr9hyJxB wT1T1PHYEsv1MGdwMclNlZWz4oannUaqQm6AnkBL+BcVq2mp50/sQIS3VKUibGvqjB77 JFkw== 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 l19-v6si468199pgc.502.2018.05.10.04.24.03; Thu, 10 May 2018 04:24:18 -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 S935394AbeEJLWd (ORCPT + 99 others); Thu, 10 May 2018 07:22:33 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:58028 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934497AbeEJLWb (ORCPT ); Thu, 10 May 2018 07:22:31 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 0FF0180494; Thu, 10 May 2018 13:22:29 +0200 (CEST) Date: Thu, 10 May 2018 13:22:29 +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: <20180510112229.GE6977@amd> References: <20180508100543.12559-1-u.kleine-koenig@pengutronix.de> <20180508100543.12559-2-u.kleine-koenig@pengutronix.de> <20180510112101.GD6977@amd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="maH1Gajj2nflutpK" Content-Disposition: inline In-Reply-To: <20180510112101.GD6977@amd> 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 --maH1Gajj2nflutpK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu 2018-05-10 13:21:01, Pavel Machek wrote: > Hi! >=20 > > 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. >=20 > Well, I'm not sure if we want to have _that_ many trigger. Trigger > interface is going to become.. "interesting". >=20 > We have 4K limit on total number of triggers. We use rather strange > interface to select trigger. >=20 > > @@ -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 >=20 > I know this is not your fault, but if you have a space or "[]" in > netdev names, confusing things will happen. Hmm. If we are doing this we really should check trigger names for forbidden characters. At least "[] " should be forbidden. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --maH1Gajj2nflutpK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlr0K3UACgkQMOfwapXb+vKCHQCeIzCRd6sZWya59FEb/WCapyef ChwAoLknzNtCk/JAfalkPnkseQxKoshk =BEdK -----END PGP SIGNATURE----- --maH1Gajj2nflutpK--