Page MenuHomeFreeBSD

hid: quiet -Wswitch
ClosedPublic

Authored by rlibby on Jan 10 2021, 7:59 AM.
Tags
None
Referenced Files
F106104700: D28082.diff
Wed, Dec 25, 11:42 AM
Unknown Object (File)
Sun, Dec 22, 8:56 PM
Unknown Object (File)
Tue, Dec 10, 6:10 AM
Unknown Object (File)
Sat, Nov 30, 12:55 PM
Unknown Object (File)
Thu, Nov 28, 12:45 AM
Unknown Object (File)
Nov 13 2024, 6:33 PM
Unknown Object (File)
Nov 11 2024, 9:46 PM
Unknown Object (File)
Nov 11 2024, 9:11 PM
Subscribers

Details

Summary

Gcc builds complained that not all switch cases are handled. Add empty
cases to appease gcc.


Please feel free to take this over and solve in any way you see fit. I
have just posted this review for expediency in case this is your
preferred approach.

Also, I am not sure whether this code has an upstream. Please advise if
so.

Test Plan
env MAKEOBJDIRPREFIX=/usr/obj/gcc9 CROSS_TOOLCHAIN=amd64-gcc9 make buildkernel

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jan 10 2021, 9:37 AM

Why not just add default: ? Anyways looks good.

Why not just add default: ? Anyways looks good.

Yes. default: looks better.

The advantage of listing cases instead of using default would be that if another enum value ever gets added, then the compiler's warning about unhandled cases won't have been suppressed. But I agree it's uglier. I'll change it to default.

Feedback: use default instead of listing cases

This revision now requires review to proceed.Jan 10 2021, 7:57 PM
This revision is now accepted and ready to land.Jan 10 2021, 9:29 PM
This revision was automatically updated to reflect the committed changes.