From owner-svn-src-all@freebsd.org Fri Dec 18 06:52:28 2015 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 1EA0BA4BD6B for ; Fri, 18 Dec 2015 06:52:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x22e.google.com (mail-qg0-x22e.google.com [IPv6:2607:f8b0:400d:c04::22e]) (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 CC13D1CE4 for ; Fri, 18 Dec 2015 06:52:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x22e.google.com with SMTP id c96so26756577qgd.3 for ; Thu, 17 Dec 2015 22:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=RgWA4qE4f61RC+K0r99mP4jNAtFCaamaj4mCTWBEKW4=; b=iOQqIE/TClTmP3G8YqzKAG+eRbfhvar1hePApmm/oVL+TiHDIIWw0s21j7ufmZVwiW qeH2TAx3WKjI7hyEykGHm7/8ClFFmLHNu4FWKZoLt3gUNlmVCtpMVGw/1uS6opYQ1X34 Ly+Z4WH6AuTagZjPNTarIjmVo+HQsIGPz4uGU9f+cUrLR+v3qX5qiPp1YQvVFaP6SuDE WEVAJm18LvUGwmiJhhn+QS034GF159qp8sa/5j3+a3cKl6w89x0BurXK54fnAWX+jNMf WbOv3ySYJ4GWSyatHqsE1ybUYBWvZoB1RAO+IuuSu6Llxy2OWF6tLL/VigwK9boMQrsY uSSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=RgWA4qE4f61RC+K0r99mP4jNAtFCaamaj4mCTWBEKW4=; b=KhVYMG+GqHYdOPYIweHc4lYVupOVLKYKWcQUcaLn6SpKkjIL29rkUyPz/31wW17xPf sI+E2HIpXjpmLpUBwFCUDbpVQC8o/fZwrOr0i8k3l57q6IQSsSKkySfwDL6uDmY7UBGL uQx38Tagsib02iEcLQUk9j7j03S4vZezt+FuGa/w6Tphbk/1Ua0DD64iktFNPAN3FLzJ qwGcKjgidrP6Vw5+5YNiE9Tm+Esj/ZmnR2BbawAbzUA/D0StnD/kjgJbhB5S+JomGdAc aiFxTt3tbby60sdxJPO+WPRKOo2Y7sYArGf9RuPADaxj6SLH12Loopy/u0RIV3iGAvis XBhg== X-Gm-Message-State: ALoCoQlsXQk1ioRiDBzqOLw7ZWBkh4q+w6fyqF25BWZoba72U2AJtYS+oUuO3IF+PDNvtkP6fOXAW7SpFe+hOig1FDbdqlGH6w== MIME-Version: 1.0 X-Received: by 10.140.40.38 with SMTP id w35mr2680859qgw.52.1450421546814; Thu, 17 Dec 2015 22:52:26 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Thu, 17 Dec 2015 22:52:26 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201512180555.tBI5tOAv057347@repo.freebsd.org> Date: Thu, 17 Dec 2015 23:52:26 -0700 X-Google-Sender-Auth: Wbazq1sza1J8tEFWEM9dMdaxXBg Message-ID: Subject: Re: svn commit: r292428 - head/sys/dev/nand From: Warner Losh To: NGie Cooper Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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: Fri, 18 Dec 2015 06:52:28 -0000 On Thu, Dec 17, 2015 at 11:36 PM, NGie Cooper wrote= : > > > On Dec 17, 2015, at 21:55, Warner Losh wrote: > > > > Author: imp > > Date: Fri Dec 18 05:55:24 2015 > > New Revision: 292428 > > URL: https://svnweb.freebsd.org/changeset/base/292428 > > > > Log: > > No need to test command values this way. There can be only one, even > > though the encoding is bit-wise today... > > What if a third party has defined other BIOs in addition to these and are > doing bitwise ORs? I know $work specialized the buf layer =E2=80=94 but w= e don=E2=80=99t > use nandfs(4) today=E2=80=A6 not sure about others... > Those applications would fail. But they would fail hard in FreeBSD's default stack due to the pervasive use of switch statements and direct tests for equality. Only one bit can ever be set in the stack today and have things actually work as intended. The only reason they are assigned as bits was so that drivers could pass whole classes of commands up / down the stack by looking at a bitmask, rather than a series of if statements. This consideration isn't relevant to the changes I made, which merely obfuscated the tests for no benefit. Warner