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)
Oct 11 2024, 3:19 PM
Unknown Object (File)
Sep 19 2024, 5:25 AM
Unknown Object (File)
Sep 18 2024, 3:18 AM
Unknown Object (File)
Sep 8 2024, 8:25 AM
Unknown Object (File)
Sep 7 2024, 11:48 AM
Unknown Object (File)
Aug 16 2024, 4:15 PM
Unknown Object (File)
May 30 2024, 7:26 PM
Unknown Object (File)
May 8 2024, 12:04 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().