mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>, Pavel Machek <pavel@ucw.cz>
Cc: y2038@lists.linaro.org, Willy Tarreau <w@1wt.eu>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [v2] leds: ledtrig-activity: use ktime_get_boot_ns()
Date: Tue, 19 Jun 2018 22:42:41 +0200	[thread overview]
Message-ID: <32253e65-4f59-f332-d631-2d5f496a0ac7@gmail.com> (raw)
In-Reply-To: <20180619082215.2990745-1-arnd@arndb.de>

Hi Arnd,

Thank you for the update.

On 06/19/2018 10:18 AM, Arnd Bergmann wrote:
> get_monotonic_boottime() is deprecated, so let's convert this to
> the simpler ktime_get_boot_ns().
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> v2: don't drop 'cpus' multiplication, as Pavel and Willy point out
>      that needs to be kept
> ---
>   drivers/leds/trigger/ledtrig-activity.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/leds/trigger/ledtrig-activity.c b/drivers/leds/trigger/ledtrig-activity.c
> index 5081894082bd..6c6f8a9b8d9a 100644
> --- a/drivers/leds/trigger/ledtrig-activity.c
> +++ b/drivers/leds/trigger/ledtrig-activity.c
> @@ -37,7 +37,6 @@ static void led_activity_function(struct timer_list *t)
>   	struct activity_data *activity_data = from_timer(activity_data, t,
>   							 timer);
>   	struct led_classdev *led_cdev = activity_data->led_cdev;
> -	struct timespec boot_time;
>   	unsigned int target;
>   	unsigned int usage;
>   	int delay;
> @@ -57,8 +56,6 @@ static void led_activity_function(struct timer_list *t)
>   		return;
>   	}
>   
> -	get_monotonic_boottime(&boot_time);
> -
>   	cpus = 0;
>   	curr_used = 0;
>   
> @@ -76,7 +73,7 @@ static void led_activity_function(struct timer_list *t)
>   	 * down to 16us, ensuring we won't overflow 32-bit computations below
>   	 * even up to 3k CPUs, while keeping divides cheap on smaller systems.
>   	 */
> -	curr_boot = timespec_to_ns(&boot_time) * cpus;
> +	curr_boot = ktime_get_boot_ns() * cpus;
>   	diff_boot = (curr_boot - activity_data->last_boot) >> 16;
>   	diff_used = (curr_used - activity_data->last_used) >> 16;
>   	activity_data->last_boot = curr_boot;
> 

Applied.

-- 
Best regards,
Jacek Anaszewski

      reply	other threads:[~2018-06-19 20:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19  8:18 Arnd Bergmann
2018-06-19 20:42 ` Jacek Anaszewski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32253e65-4f59-f332-d631-2d5f496a0ac7@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=w@1wt.eu \
    --cc=y2038@lists.linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®