From patchwork Sun May 10 16:55:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11539793 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C13C1912 for ; Mon, 11 May 2020 07:18:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9EEC82080C for ; Mon, 11 May 2020 07:18:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LgVoPKRX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9EEC82080C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7D6186E20E; Mon, 11 May 2020 07:17:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6FD4989F8E for ; Sun, 10 May 2020 16:55:44 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id x17so7960123wrt.5 for ; Sun, 10 May 2020 09:55:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SCZR0RDMG3XJhGAGRvblpDgemNbadL77Ape7/cMT2Jk=; b=LgVoPKRXtKyWOqYktFWRpIfKlpXdA950wCd2yJkk1y6mRWG9CgvwhxCh+VLXpXYi8G isZlsRVnB2AJfLgDpBf5IwLL+F+xLLm+vLe5V8dfFZ1lZ5XxiQN1M+euNM0cjj8s6dxT 4y3jVmrE0FzRMojZ1yZZw1dT+gmZ7jPBZFO7tFnCMJhrHGQSd9XmAV4gGs0aLissqb98 UiLnV2bb5HGcSGff55PmCb2b9neSqsPsctfKOJWOLJBxeLc0n/RMBYmAzW2bxvzZ1o7G ca7cOJPGz/1a4XLT6HD1Y0EKIZy2oDbA8DL6NGUCyrNQm5rMurIRCp1EksMFjVRmDR1V 77tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SCZR0RDMG3XJhGAGRvblpDgemNbadL77Ape7/cMT2Jk=; b=eLhBPop3xHwRvg+GnMCIJ9Z9iBo0iYefNILwrApl7xJVypORxV+J01FUFmfJwNb363 GFIjkbR3RFEF0I9fCRddO4AJGsQz3A9SDv4YELLtRyn4flKatYF6jXWZA8eT9rCDFnYq Sg6RaQHfB3k6278OoOH6H2i/WnyRjvSacuwmkPtprnoJhP9Rb08pI9UCiLlbHaly4wGL gdI0HqVwEQsFFOqjzO9fKnqDjUqZfuGzzZtYtVjXzj42Mg1HoGnA6R7aVYTx78yJzJQ3 XTIf+ArSoQTlcbXqqZb0HLzFNFk22+E6UMxY2P5PYZA5yrxS6V7EEzIfejQixunN/guQ Rlpg== X-Gm-Message-State: AGi0Pub1pnEJJFpHRvA9RN3M7EdxJc2y4TkWPeLCrQ9fZuil3cKJUTpZ mHan+1dfbGtvUuMKx+ODFbE= X-Google-Smtp-Source: APiQypKtLpPlZkPTEpuhPfSdLDXG2WtCWVp/p+U2lL9gCsx/HvonVK58WW19yileLXj8XmEnrOCQcQ== X-Received: by 2002:adf:afd6:: with SMTP id y22mr13959393wrd.417.1589129743009; Sun, 10 May 2020 09:55:43 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0:1cc8:b1f1:a2b8:a1ee]) by smtp.gmail.com with ESMTPSA id g15sm13637670wrp.96.2020.05.10.09.55.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 09:55:42 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH 01/15] drm/panfrost: avoid static declaration Date: Sun, 10 May 2020 18:55:24 +0200 Message-Id: <20200510165538.19720-2-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200510165538.19720-1-peron.clem@gmail.com> References: <20200510165538.19720-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 11 May 2020 07:17:28 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This declaration can be avoided so change it. Signed-off-by: Clément Péron Reviewed-by: Steven Price --- 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);