Page MenuHomeFreeBSD

Add a INTR_TRIG_INVALID, and use it in the powerpc interrupt code.
ClosedPublic

Authored by jhibbits on Jan 23 2017, 4:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 12:18 AM
Unknown Object (File)
Dec 8 2023, 10:47 AM
Unknown Object (File)
Dec 2 2023, 8:00 PM
Unknown Object (File)
Oct 17 2023, 7:53 PM
Unknown Object (File)
Oct 10 2023, 7:18 AM
Unknown Object (File)
Sep 19 2023, 4:31 PM
Unknown Object (File)
Jul 4 2023, 11:31 PM
Unknown Object (File)
Jun 27 2023, 2:08 AM
Subscribers

Details

Summary

Clang throws the following warning in powerpc intr_machdep:

/usr/src/sys/powerpc/powerpc/intr_machdep.c:454:15: warning: comparison of
constant -1 with expression of type 'enum intr_trigger' is always false
[-Wtautological-constant-out-of-range-compare]

if (i->trig == -1)

~~~~~~~ ^ ~~

This may lead to legitimate problems with aggressive optimizations, if not now
then in the future. To avoid this, add a new enum, INTR_TRIG_INVALID, set to
-1, and use this new enumeration in these checks.

Test Plan

Compile test.

Diff Detail

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

Event Timeline

jhibbits retitled this revision from to Add a INTR_TRIG_INVALID, and use it in the powerpc interrupt code..
jhibbits updated this object.
jhibbits edited the test plan for this revision. (Show Details)
jhibbits added reviewers: jhb, nwhitehorn, kib.

Did you compiled universe with the patch ? My concern is that now switch() statements which handled three existing INTR_TRIGGER_XXX values become incomplete and potentially trigger corresponding warning.

In D9300#192273, @kib wrote:

Did you compiled universe with the patch ? My concern is that now switch() statements which handled three existing INTR_TRIGGER_XXX values become incomplete and potentially trigger corresponding warning.

Nope, but that's a good point, didn't think about it. I'll kick off a universe build soon. If the fallout is too great, I may instead make the struct member an int instead of the enum, but if it's small enough, I can make the changes in the other files.

In D9300#192273, @kib wrote:

Did you compiled universe with the patch ? My concern is that now switch() statements which handled three existing INTR_TRIGGER_XXX values become incomplete and potentially trigger corresponding warning.

Nope, but that's a good point, didn't think about it. I'll kick off a universe build soon. If the fallout is too great, I may instead make the struct member an int instead of the enum, but if it's small enough, I can make the changes in the other files.

Universe completed successfully (3 unrelated failures in netmap for powerpc and sparc LINT), and I see no warnings for this in the logs.

jhb edited edge metadata.
This revision is now accepted and ready to land.Jan 27 2017, 6:59 PM
kib edited edge metadata.
This revision was automatically updated to reflect the committed changes.