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)
Thu, Dec 11, 1:29 AM
Unknown Object (File)
Wed, Dec 10, 9:18 PM
Unknown Object (File)
Sun, Dec 7, 1:05 AM
Unknown Object (File)
Wed, Dec 3, 9:05 AM
Unknown Object (File)
Sat, Nov 29, 9:47 PM
Unknown Object (File)
Sat, Nov 29, 8:25 AM
Unknown Object (File)
Fri, Nov 28, 5:09 AM
Unknown Object (File)
Wed, Nov 26, 10:32 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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17177
Build 17029: arc lint + arc unit

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
225–227

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.