Page MenuHomeFreeBSD

thunderbolt: make code -Wunused clean
Needs ReviewPublic

Authored by ngie on Fri, Feb 27, 8:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 20, 9:29 PM
Unknown Object (File)
Fri, Mar 20, 12:53 AM
Unknown Object (File)
Fri, Mar 20, 12:44 AM
Unknown Object (File)
Tue, Mar 17, 12:40 PM
Unknown Object (File)
Sat, Mar 7, 8:25 PM
Unknown Object (File)
Thu, Mar 5, 11:18 AM
Unknown Object (File)
Tue, Mar 3, 6:19 PM
Unknown Object (File)
Sun, Mar 1, 12:11 PM
Subscribers
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This change modifies code paths and uses __used to address -Wunused
issues that occur when THUNDERBOLT_DEBUG == 0.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 71082
Build 67965: arc lint + arc unit

Event Timeline

ngie requested review of this revision.Fri, Feb 27, 8:52 PM

thanks for this!

in general, can't we just use __used on maybe-unused declarations? smaller diff & more idiomatic wrt having sc defined everywhere without doing r->sc. but I'm nitpicking here so I'm okay with accepting this as is

sys/dev/thunderbolt/nhi.c
908–911

why don't we just use __used here as suggested in the description of this revision?

sys/dev/thunderbolt/tb_debug.h
84

why this change? Do we want this code to be built if THUNDERBOLT_DEBUG is 0?

but also if we wanted to preserve the existing logic we could simplify the previous check with just #if THUNDERBOLT_DEBUG > 0 since undefined identifiers evaluate to 0.