Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Apr 2017 16:59:30 +0000
From:      David O'Brien <obrien@FreeBSD.ORG>
To:        "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com>
Cc:        "David E. O'Brien" <obrien@FreeBSD.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r316591 - head/sys/dev/tpm
Message-ID:  <20170408165930.GA22358@freefall.freebsd.org>
In-Reply-To: <F4902DBF-9E62-4ED0-8960-851E43F4F745@gmail.com>
References:  <201704062221.v36MLnr7092648@repo.freebsd.org> <F4902DBF-9E62-4ED0-8960-851E43F4F745@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Apr 06, 2017 at 10:19:48PM -0700, Ngie Cooper (yaneurabeya) wrote:
> > On Apr 6, 2017, at 15:21, David E. O'Brien <obrien@FreeBSD.org> wrote:
> Hi David,
> 	I think you meant to delete the other piece of code (__FreeBSD__ is
> 	always defined).

Hi Ngie,
I removed 100% dead code.  This was a block of code that could never be active.

The code supported two cases:
1. __FreeBSD__ being defined
2. __FreeBSD__ not being defined.  No attention was paid to any other
   (such as __OpenBSD__).


The code I deleted could never be activated.  So it was an obvious thing
to remove even if the OpenBSD support is kept.

I have a patch to unifdef(1) the code at:

https://reviews.freebsd.org/D10321


> Also, why delete lines that might make it harder to backport changes
> from OpenBSD?

It is hard to read this code and follow its flow with the multiple versions
of the same functions.  I ported this driver to Junos on MIPS and it was
much simpler to read, enhance, and debug without the OpenBSD bits.

Also, there is no evidence this still works on OpenBSD.

OpenBSD never accepted this driver, and instead wrote their own minimal
driver (sys/dev/acpi/tpm.c for suspending the device).  OpenBSD has no
interest in this driver.

So we're carrying around needless baggage.

-- 
-- David    (obrien@FreeBSD.org)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170408165930.GA22358>