Page MenuHomeFreeBSD

powerpc64: Avoid type promotion
ClosedPublic

Authored by breno.leitao_gmail.com on Jun 11 2018, 7:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Feb 28, 2:07 PM
Unknown Object (File)
Dec 23 2023, 3:25 AM
Unknown Object (File)
Dec 21 2023, 10:44 PM
Unknown Object (File)
Dec 20 2023, 5:03 AM
Unknown Object (File)
Dec 12 2023, 5:55 AM
Unknown Object (File)
Nov 30 2023, 8:46 AM
Unknown Object (File)
Nov 27 2023, 10:52 PM
Unknown Object (File)
Nov 27 2023, 12:42 AM
Subscribers

Details

Summary

There is a type promotion that transform count = -1 into a unsigned int causing
the default TCE SEG SIZE not being returned on a Boston POWER9 machine.
This machine does not have the 'ibm,supported-tce-sizes' entries, thus, count
is set to -1, and the function continue to execute instead of returning.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This can be simplified to just "if (count < (int)sizeof(cell_t))"

Adjusting to follow jhibbits' suggestion.

sys/powerpc/powernv/opal_pci.c
224 ↗(On Diff #43623)

Looks good, except the semicolon at the end ;)

This revision is now accepted and ready to land.Jun 12 2018, 6:45 PM
This revision was automatically updated to reflect the committed changes.