From owner-svn-src-head@freebsd.org Mon Jul 11 17:01:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CF3FB92475; Mon, 11 Jul 2016 17:01:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE7371D7D; Mon, 11 Jul 2016 17:01:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6BH181S083053; Mon, 11 Jul 2016 17:01:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6BH189R083052; Mon, 11 Jul 2016 17:01:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201607111701.u6BH189R083052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 11 Jul 2016 17:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302577 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2016 17:01:09 -0000 Author: ngie Date: Mon Jul 11 17:01:07 2016 New Revision: 302577 URL: https://svnweb.freebsd.org/changeset/base/302577 Log: Add missing default case to capable(..) function definition 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 case 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. Differential Revision: https://reviews.freebsd.org/D7188 MFC after: 1 week Reported by: devel/amd64-gcc (5.3.0) Reviewed by: dumbbell Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/drm2/drm_os_freebsd.h Modified: head/sys/dev/drm2/drm_os_freebsd.h ============================================================================== --- head/sys/dev/drm2/drm_os_freebsd.h Mon Jul 11 16:56:51 2016 (r302576) +++ head/sys/dev/drm2/drm_os_freebsd.h Mon Jul 11 17:01:07 2016 (r302577) @@ -438,6 +438,10 @@ capable(enum __drm_capabilities cap) switch (cap) { case CAP_SYS_ADMIN: return DRM_SUSER(curthread); + default: + KASSERT(false, + ("%s: unhandled capability: %0x", __func__, cap)); + return (false); } }