From owner-svn-src-head@freebsd.org Thu Apr 21 18:25:56 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 66FABB17FFB for ; Thu, 21 Apr 2016 18:25:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm30-vm0.bullet.mail.bf1.yahoo.com (nm30-vm0.bullet.mail.bf1.yahoo.com [98.139.213.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11060108A for ; Thu, 21 Apr 2016 18:25:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461263148; bh=nUm43aE+cy+5ayDdSnkBw56Ch+Ca42lxLti62OnPReY=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=GALWl+MlWuxxVx/rbwlzTrtCjUN82gttot8yR81gtlPdTOdAsiolSce23AZUdRZ3FCK4wM0xSSE+BMRlqs9SW1TJ33LBU0tLN1dMnfIRImpEeAbyoyi3KQaxjc9TtHKAugMgr8jVf9+vuyhkrsbZLDLa1Pa0BXGhSCZnfeyQDNZiOK+5dKSJvu+dtGk38oCTwRliHU2NZXLvwuez0CZucrTTVnSB1hMr4aXNb+vC12VQeElG6swhvE2vD64L6e42WpyXd05e5Ct3kdvIS1vF4I6+g9qzDkar7WBOtS0eW5NqIx68HeWNbJ/JonQZH87dv3cJ7tfjhQiY2wrd0NqBCQ== Received: from [66.196.81.171] by nm30.bullet.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 18:25:48 -0000 Received: from [68.142.230.70] by tm17.bullet.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 18:25:48 -0000 Received: from [127.0.0.1] by smtp227.mail.bf1.yahoo.com with NNFMP; 21 Apr 2016 18:25:48 -0000 X-Yahoo-Newman-Id: 293055.53103.bm@smtp227.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: neVIQUkVM1nH53.m5ZfhXkrYh_QDd9I4uwv6bpD9o9ipdOX vcc44_YNFgjGmdD8u1gnCUnofaGISMjmP5IkQI8nUgj6zX8NzYW5.ALy7TwM IiXmYuEh.XmnmdEmSvyZ3dB7fdoZuEVkvICFimvGk_x82FUA9vOq1GtIf1Uz sYHxw5lJbiKLI3EsS0TkaIxEywXbnxEV4i_CYRvKSelUgsCCYRi3JLdsmqSy 1._kZn3vkgkNl.G_cOhfy9ubgmE9hClYoSibfn8TaIDHZFDadVwvddBv2LVH xXcJIMzIvWkI6WDg5ZqT9ob.m03utBJMKhQr9oMBmDan3.MssVpboi5SLO8Q Ez_YFQok2SpUh_AXjCmGgdtL7aF5kCK2OwYY50WMpcwjfd4nJTlw211Yp5Ci 7UIwDNPCUxKnnpP7RJgPR_48zYaMTveDQdc4WoyO248r5_5RI79We_kjx8q7 98lN9XHCtsjx1.Mp511eg4B8IIE6.yt1vfkuqQmc.C5fHdnV61hoKzRDQGnx J0yoQklKY3gNrtdbCSfRNLIon0db3Fk2F X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298412 - head/sys/ofed/drivers/infiniband/core To: Hans Petter Selasky , Juli Mallett References: <201604211604.u3LG4wmT035874@repo.freebsd.org> <57190C47.8070106@selasky.org> <5719150F.7030200@FreeBSD.org> <5719180F.90509@selasky.org> Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: <57191B33.7070406@FreeBSD.org> Date: Thu, 21 Apr 2016 13:25:55 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <5719180F.90509@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 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: Thu, 21 Apr 2016 18:25:56 -0000 On 21/04/2016 13:12, Hans Petter Selasky wrote: > On 04/21/16 19:59, Pedro Giffuni wrote: >> >> >> On 21/04/2016 12:52, Juli Mallett wrote: >>> On Thu, Apr 21, 2016 at 10:22 AM, Hans Petter Selasky >>> wrote: >>>> On 04/21/16 19:12, Ngie Cooper wrote: > > Hi, > >>> Then there should be an assertion or something else of that sort (I >>> forget if we have a __builtin_unreachable()-alike macro in the kernel; >>> the lint(1)y NOTREACHED isn't as nice as actual code) so that it is >>> apparent to a human that this case cannot be reached. The presence of >>> a do-nothing default case is not typically indicative of unreachable >>> code. >> >> We do have __unreachable() in cdefs.h >> >> It should work with both GCC and clang. >> >> Pedro. >> > > I don't see anyone using __unreachable() yet in the kernel. Do you > recommend it over a KASSERT() ? > It's a rather recent addition (I added it after checking NetBSD's cdefs). It is meant mostly for the compiler/static analyzers. From the clang documentation: "The __builtin_unreachable() builtin has completely undefined behavior. Since it has undefined behavior, it is a statement that it is never reached and the optimizer can take advantage of this to produce better code. This builtin takes no arguments and produces a void result." There was some discussion before it was introduced about turning it into an assertion, but I recall it was not possible. hth, Pedro.