From owner-svn-src-all@freebsd.org Wed Jul 13 23:56:41 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 BFA44B98FA7; Wed, 13 Jul 2016 23:56:41 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x22c.google.com (mail-qt0-x22c.google.com [IPv6:2607:f8b0:400d:c0d::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7892D15F6; Wed, 13 Jul 2016 23:56:41 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x22c.google.com with SMTP id 52so34764631qtq.3; Wed, 13 Jul 2016 16:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Z0pV2YMDcpXVRtly1SBy5PmF8Kv7tpeVv3GMKoQrf1I=; b=K2TbRlFlPQMPGS4ojl8EbEXYC8lJ9J02ZROlOIsetHvO7lNUTe7iSf/CSIvkNCsQoW kvBGwNcSxDzavOIIJV0sb2A4ve1qOMmRDim6Dy9K4ITGXpJclSEi+OpoW7pz5M4EIvyw tTcVd3NB+4VGp17Gk3AI6lqbxYTIsvkJEUMBXREp2tCx7GuAjOJTMvAUIaDVdti4OS31 0Pn58z+RvKW6LpeoSiIc4AL3vz+nRz5U/4U24JBG/IGiRS8q2ezna6RObmp9jkMn3ekh RsVPPcH2VRohML091RYG3TxcdFvCAoKeBZZvtaq5YEjBfK/mqK+w8u9M68K8bF4Gyf1f 8/bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Z0pV2YMDcpXVRtly1SBy5PmF8Kv7tpeVv3GMKoQrf1I=; b=kahETeh5rOIr9IFsFrgqz6O4u9914Qusbt/d9TnhQARt3oJUHYaBKVf4W90RfnSZGt q1y5yxIYwDrjtNpsXMlPcD8XPluzzUW2RIZ5qIXc5dsjwD0d/OHBzonsV6ZArxX0fcQH dOrWJIWTcnRkOAb/tTj0zU++TZFSuyIwTrfV3u1A2b69PzKEJdLSvx8MUrK05ZvhhxYj jLvyr6VWU2j21btmkTqU+IDHrtPbE+D+VAmQoWJKzWQeLjiQOl1Yp0oQcuPsL5V11pi/ 6ah2h7liVIVo+K7Y1rBZofyKfL1GpE0Uj2ncBeTdcxQrobrpxf+dVPCJ73eb691S93A0 0zzg== X-Gm-Message-State: ALyK8tJWJJbIHqMxfjkn+eOfVbXJvMQI7HWkYzUTNg599pEgT3wFr2ALc2hbPWgkrGckntHGT3c6F6lm31SSJQ== X-Received: by 10.237.36.38 with SMTP id r35mr16634861qtc.3.1468454200354; Wed, 13 Jul 2016 16:56:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.148.131 with HTTP; Wed, 13 Jul 2016 16:56:39 -0700 (PDT) In-Reply-To: References: <201607111701.u6BH189R083052@repo.freebsd.org> From: Ngie Cooper Date: Wed, 13 Jul 2016 16:56:39 -0700 Message-ID: Subject: Re: svn commit: r302577 - head/sys/dev/drm2 To: Robert Watson Cc: Garrett Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 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 23:56:41 -0000 On Wed, Jul 13, 2016 at 4:54 AM, Robert Watson wrote: > 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. Good point. I'll commit the change tonight. Thanks! -Ngie