From 6251021c8062e58d25a96cddfce3a1a74f7078a4 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Sun, 2 Apr 2023 09:13:26 +0000 Subject: [PATCH] drm: tegra: virt: Fix compilation warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix following compilation warning when build as OOT module: virt.c:270:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] virt.c:345:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long int’ [-Wformat=] Bug 4052299 Change-Id: I8eb33d9c8b0e9847ca76b812ce2ebcf6e65adf96 Signed-off-by: Laxman Dewangan --- drivers/gpu/drm/tegra/virt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tegra/virt.c b/drivers/gpu/drm/tegra/virt.c index 282e6792..ee2b7b0c 100644 --- a/drivers/gpu/drm/tegra/virt.c +++ b/drivers/gpu/drm/tegra/virt.c @@ -252,6 +252,7 @@ static int actmon_debugfs_usage_show(struct seq_file *s, void *unused) { struct virt_engine *virt = s->private; unsigned long rate; + int cycles_per_actmon_sample; int count; rate = clk_get_rate(virt->clk); @@ -267,7 +268,7 @@ static int actmon_debugfs_usage_show(struct seq_file *s, void *unused) /* Based on configuration in NvHost Server */ #define ACTMON_SAMPLE_PERIOD_US 100 /* Rate in MHz cancels out microseconds */ - int cycles_per_actmon_sample = (rate / 1000000) * ACTMON_SAMPLE_PERIOD_US; + cycles_per_actmon_sample = (rate / 1000000) * ACTMON_SAMPLE_PERIOD_US; seq_printf(s, "%d\n", (count * 1000) / cycles_per_actmon_sample); @@ -342,7 +343,7 @@ static int virt_engine_probe(struct platform_device *pdev) virt->clk = devm_clk_get_optional(&pdev->dev, NULL); if (IS_ERR(virt->clk)) { - dev_err(dev, "could not get clock: %d\n", PTR_ERR(virt->clk)); + dev_err(dev, "could not get clock: %ld\n", PTR_ERR(virt->clk)); return PTR_ERR(virt->clk); }