drm: tegra: virt: Fix compilation warning

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 <ldewangan@nvidia.com>
This commit is contained in:
Laxman Dewangan
2023-04-02 09:13:26 +00:00
parent 5ad064a2bb
commit 6251021c80

View File

@@ -252,6 +252,7 @@ static int actmon_debugfs_usage_show(struct seq_file *s, void *unused)
{ {
struct virt_engine *virt = s->private; struct virt_engine *virt = s->private;
unsigned long rate; unsigned long rate;
int cycles_per_actmon_sample;
int count; int count;
rate = clk_get_rate(virt->clk); 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 */ /* Based on configuration in NvHost Server */
#define ACTMON_SAMPLE_PERIOD_US 100 #define ACTMON_SAMPLE_PERIOD_US 100
/* Rate in MHz cancels out microseconds */ /* 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); 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); virt->clk = devm_clk_get_optional(&pdev->dev, NULL);
if (IS_ERR(virt->clk)) { 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); return PTR_ERR(virt->clk);
} }