From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69C0721CED for ; Wed, 10 May 2023 22:53:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACEF6C433EF; Wed, 10 May 2023 22:53:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1683759196; bh=0SZCsJwaN3AewUnoK7ahUFPcOXKKisj7UKcNsbIMmPI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XQc6WYHRDg0MBsZEyfCJ+vnkMjJlaVGOEx3mwuGtVdl5YOeoVKISE+iU91Kis8YeS oiuGG6EB+L8X4l2LTlLW4tSagbRG6Euq8Qsedz3o1mAtfEDf1SBV4tgBd5gSPpMDG5 vIrRC4772kxNLYeCzjZ9oQoZU2ydqNJS6DFET+TE= Date: Thu, 11 May 2023 07:53:09 +0900 From: Greg Kroah-Hartman To: Hans de Goede Cc: Pavel Machek , Jacek Anaszewski , Lee Jones , Sebastian Reichel , Michael Grzeschik , Johannes Berg , Pablo Neira Ayuso , Jozsef Kadlecsik , linux-leds@vger.kernel.org, linux-pm@vger.kernel.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, Yauhen Kharuzhy Subject: Re: [PATCH RESEND 1/4] leds: Change led_trigger_blink[_oneshot]() delay parameters to pass-by-value Message-ID: <2023051102-reseller-oat-3566@gregkh> References: <20230510162234.291439-1-hdegoede@redhat.com> <20230510162234.291439-2-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230510162234.291439-2-hdegoede@redhat.com> On Wed, May 10, 2023 at 06:22:31PM +0200, Hans de Goede wrote: > led_blink_set[_oneshot]()'s delay_on and delay_off function parameters > are pass by reference, so that hw-blink implementations can report > back the actual achieved delays when the values have been rounded > to something the hw supports. > > This is really only interesting for the sysfs API / the timer trigger. > Other triggers don't really care about this and none of the callers of > led_trigger_blink[_oneshot]() do anything with the returned delay values. > > Change the led_trigger_blink[_oneshot]() delay parameters to pass-by-value, > there are 2 reasons for this: > > 1. led_cdev->blink_set() may sleep, while led_trigger_blink() may not. > So on hw where led_cdev->blink_set() sleeps the call needs to be deferred > to a workqueue, in which case the actual achieved delays are unknown > (this is a preparation patch for the deferring). > > 2. Since the callers don't care about the actual achieved delays, allowing > callers to directly pass a value leads to simpler code for most callers. > > Reviewed-by: Jacek Anaszewski > Tested-by: Yauhen Kharuzhy > Signed-off-by: Hans de Goede Acked-by: Greg Kroah-Hartman