From owner-svn-src-all@freebsd.org Wed Jul 13 11:54:03 2016 Return-Path: Delivered-To: svn-src-all@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 94194B97F9B; Wed, 13 Jul 2016 11:54:03 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id 769C71EBC; Wed, 13 Jul 2016 11:54:03 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [198.74.231.63]) by cyrus.watson.org (Postfix) with ESMTPS id 7591946B51; Wed, 13 Jul 2016 07:54:02 -0400 (EDT) Date: Wed, 13 Jul 2016 12:54:01 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Garrett Cooper cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302577 - head/sys/dev/drm2 In-Reply-To: <201607111701.u6BH189R083052@repo.freebsd.org> Message-ID: References: <201607111701.u6BH189R083052@repo.freebsd.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2016 11:54:03 -0000 On Mon, 11 Jul 2016, Garrett Cooper wrote: > 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 Per my comment in the review, I think a panic() here would be preferable to a KASSERT(), as it would come without perceptible runtime cost, and failstop the system if we were violating a design-time security invariant. Robert