Page MenuHomeFreeBSD

powerpc64: Avoid type promotion

Authored by on Jun 11 2018, 7:27 PM.



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

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Better approach forcing promotion.

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

Adjusting to follow jhibbits' suggestion.

wma added inline comments.Jun 12 2018, 4:34 AM
224 ↗(On Diff #43623)

Looks good, except the semicolon at the end ;)

Fixing silly error.

jhibbits accepted this revision.Jun 12 2018, 6:45 PM
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.