Page MenuHomeFreeBSD

powerpc: change mfpvr return type to uint32_t
ClosedPublic

Authored by luporl on Jul 28 2021, 12:41 PM.
Tags
None
Referenced Files
F104821534: D31332.id92855.diff
Mon, Dec 9, 11:57 PM
Unknown Object (File)
Wed, Nov 20, 8:59 AM
Unknown Object (File)
Oct 23 2024, 1:17 PM
Unknown Object (File)
Oct 23 2024, 10:27 AM
Unknown Object (File)
Oct 5 2024, 11:50 PM
Unknown Object (File)
Oct 4 2024, 11:01 AM
Unknown Object (File)
Oct 3 2024, 4:54 PM
Unknown Object (File)
Sep 30 2024, 6:54 AM
Subscribers

Details

Summary

As the Processor Version Register (PVR) is a 32-bit PowerPC
register, change mfpvr() return type to match it and avoid
type casts on its callers.

Suggested by: jhibbits

Test Plan

Tested on POWER9 VM and build tested on powerpc (32-bit).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jul 28 2021, 2:21 PM

minor quibble, but likely not worth addressing.

sys/dev/hwpmc/hwpmc_powerpc.c
607

mfpvr() doesn't return an int now, but a uint32_t which can be either an int or a long. so there's still a mismatch here, just not one the compiler warns about. In the past, this would be a sure way to get a mismatch between 32-bit and 64-bit compiles, but it seems we've moved to always defining uint32_t as an unsigned int. At least the 'x' format is unsigned...

This revision was automatically updated to reflect the committed changes.