svn commit: r316591 - head/sys/dev/tpm

David O'Brien obrien at FreeBSD.ORG
Sat Apr 8 16:59:31 UTC 2017


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 at 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 at FreeBSD.org)


More information about the svn-src-head mailing list