Page MenuHomeFreeBSD

Add missing default case to capable(..) function definition
ClosedPublic

Authored by ngie on Jul 11 2016, 4:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 12:27 AM
Unknown Object (File)
Nov 9 2023, 1:32 PM
Unknown Object (File)
Nov 6 2023, 6:56 PM
Unknown Object (File)
Oct 8 2023, 12:27 PM
Unknown Object (File)
Oct 5 2023, 6:06 PM
Unknown Object (File)
Jun 29 2023, 10:15 PM
Unknown Object (File)
Jun 29 2023, 11:06 AM
Unknown Object (File)
Jun 3 2023, 11:16 PM
Subscribers

Details

Reviewers
dumbbell
Summary

By definition (enum __drm_capabilities), cases other than CAP_SYS_ADMIN
aren't possible. Add in a KASSERT safety belt and return false in
!INVARIANTS cases if an invalid value is passed in, as it would be a
programmer error.

This fixes a -Wreturn-type error with gcc 5.3.0.

MFC after: 1 week
Reported by: devel/amd64-gcc (5.3.0)
Sponsored by: EMC / Isilon Storage Division

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

ngie retitled this revision from to Add missing default case to capable(..) function definition.
ngie updated this object.
ngie edited the test plan for this revision. (Show Details)
ngie added a reviewer: dumbbell.
ngie set the repository for this revision to rS FreeBSD src repository - subversion.
ngie added a subscriber: rwatson.
dumbbell edited edge metadata.
This revision is now accepted and ready to land.Jul 11 2016, 4:22 PM

I think using panic() here would be preferable to KASSERT().