lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 28 May 2020 14:22:31 +0100
From:   Steven Price <steven.price@....com>
To:     Clément Péron <peron.clem@...il.com>,
        Rob Herring <robh@...nel.org>,
        Tomeu Vizoso <tomeu.vizoso@...labora.com>,
        Alyssa Rosenzweig <alyssa.rosenzweig@...labora.com>,
        Viresh Kumar <vireshk@...nel.org>, Nishanth Menon <nm@...com>,
        Stephen Boyd <sboyd@...nel.org>,
        Maxime Ripard <mripard@...nel.org>,
        Chen-Yu Tsai <wens@...e.org>
Cc:     dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 01/15] drm/panfrost: avoid static declaration

On 10/05/2020 17:55, Clément Péron wrote:
> This declaration can be avoided so change it.
> 
> Signed-off-by: Clément Péron <peron.clem@...il.com>

Reviewed-by: Steven Price <steven.price@....com>

> ---
>   drivers/gpu/drm/panfrost/panfrost_devfreq.c | 38 ++++++++++-----------
>   1 file changed, 18 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
> index 413987038fbf..1b560b903ea6 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
> @@ -14,7 +14,24 @@
>   #include "panfrost_gpu.h"
>   #include "panfrost_regs.h"
>   
> -static void panfrost_devfreq_update_utilization(struct panfrost_device *pfdev);
> +static void panfrost_devfreq_update_utilization(struct panfrost_device *pfdev)
> +{
> +	ktime_t now;
> +	ktime_t last;
> +
> +	if (!pfdev->devfreq.devfreq)
> +		return;
> +
> +	now = ktime_get();
> +	last = pfdev->devfreq.time_last_update;
> +
> +	if (atomic_read(&pfdev->devfreq.busy_count) > 0)
> +		pfdev->devfreq.busy_time += ktime_sub(now, last);
> +	else
> +		pfdev->devfreq.idle_time += ktime_sub(now, last);
> +
> +	pfdev->devfreq.time_last_update = now;
> +}
>   
>   static int panfrost_devfreq_target(struct device *dev, unsigned long *freq,
>   				   u32 flags)
> @@ -139,25 +156,6 @@ void panfrost_devfreq_suspend(struct panfrost_device *pfdev)
>   	devfreq_suspend_device(pfdev->devfreq.devfreq);
>   }
>   
> -static void panfrost_devfreq_update_utilization(struct panfrost_device *pfdev)
> -{
> -	ktime_t now;
> -	ktime_t last;
> -
> -	if (!pfdev->devfreq.devfreq)
> -		return;
> -
> -	now = ktime_get();
> -	last = pfdev->devfreq.time_last_update;
> -
> -	if (atomic_read(&pfdev->devfreq.busy_count) > 0)
> -		pfdev->devfreq.busy_time += ktime_sub(now, last);
> -	else
> -		pfdev->devfreq.idle_time += ktime_sub(now, last);
> -
> -	pfdev->devfreq.time_last_update = now;
> -}
> -
>   void panfrost_devfreq_record_busy(struct panfrost_device *pfdev)
>   {
>   	panfrost_devfreq_update_utilization(pfdev);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ