Skip to content

Commit 7f5231b

Browse files
Shyam Sundar S Kjwrdegoede
authored andcommitted
platform/x86: amd-pmc: Fix undefined reference to __udivdi3
It was reported that on i386 config ------ on i386: ld: drivers/platform/x86/amd-pmc.o: in function `s0ix_stats_show': amd-pmc.c:(.text+0x100): undefined reference to `__udivdi3' ------- The reason for this is that 64-bit integer division is not supported on 32-bit architecture. Use do_div macro to fix this. Fixes: b9a4fa6 ("platform/x86: amd-pmc: Add support for logging s0ix counters") Reported-by: Randy Dunlap <[email protected]> Signed-off-by: Shyam Sundar S K <[email protected]> Reviewed-by: Randy Dunlap <[email protected]> # and build-tested Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
1 parent 95edbbf commit 7f5231b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/platform/x86/amd-pmc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ static int s0ix_stats_show(struct seq_file *s, void *unused)
189189
exit_time = exit_time << 32 | ioread32(dev->fch_virt_addr + FCH_S0I3_EXIT_TIME_L_OFFSET);
190190

191191
/* It's in 48MHz. We need to convert it */
192-
residency = (exit_time - entry_time) / 48;
192+
residency = exit_time - entry_time;
193+
do_div(residency, 48);
193194

194195
seq_puts(s, "=== S0ix statistics ===\n");
195196
seq_printf(s, "S0ix Entry Time: %lld\n", entry_time);

0 commit comments

Comments
 (0)