Module Name:    src
Committed By:   riastradh
Date:           Mon Jan  4 18:22:19 UTC 2021

Modified Files:
        src/sys/dev/ic: tpm.c tpmreg.h tpmvar.h

Log Message:
dev/ic/tpm: Tidy up headers.

- Add include guards.
- Add necessary includes.
- Sort includes.
- Use _BYTE_ORDER, not BYTE_ORDER, for public header.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/ic/tpm.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/tpmreg.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/ic/tpmvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/tpm.c
diff -u src/sys/dev/ic/tpm.c:1.16 src/sys/dev/ic/tpm.c:1.17
--- src/sys/dev/ic/tpm.c:1.16	Wed Oct  9 14:03:58 2019
+++ src/sys/dev/ic/tpm.c	Mon Jan  4 18:22:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tpm.c,v 1.16 2019/10/09 14:03:58 maxv Exp $	*/
+/*	$NetBSD: tpm.c,v 1.17 2021/01/04 18:22:19 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -48,17 +48,19 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tpm.c,v 1.16 2019/10/09 14:03:58 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tpm.c,v 1.17 2021/01/04 18:22:19 riastradh Exp $");
 
 #include <sys/param.h>
-#include <sys/systm.h>
+#include <sys/types.h>
+
+#include <sys/bus.h>
+#include <sys/conf.h>
+#include <sys/device.h>
 #include <sys/kernel.h>
 #include <sys/malloc.h>
-#include <sys/proc.h>
-#include <sys/device.h>
-#include <sys/conf.h>
-#include <sys/bus.h>
 #include <sys/pmf.h>
+#include <sys/proc.h>
+#include <sys/systm.h>
 
 #include <dev/ic/tpmreg.h>
 #include <dev/ic/tpmvar.h>

Index: src/sys/dev/ic/tpmreg.h
diff -u src/sys/dev/ic/tpmreg.h:1.6 src/sys/dev/ic/tpmreg.h:1.7
--- src/sys/dev/ic/tpmreg.h:1.6	Wed Oct  9 07:30:58 2019
+++ src/sys/dev/ic/tpmreg.h	Mon Jan  4 18:22:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tpmreg.h,v 1.6 2019/10/09 07:30:58 maxv Exp $	*/
+/*	$NetBSD: tpmreg.h,v 1.7 2021/01/04 18:22:19 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -29,7 +29,15 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#if (BYTE_ORDER == LITTLE_ENDIAN)
+#ifndef	DEV_IC_TPMREG_H
+#define	DEV_IC_TPMREG_H
+
+#include <sys/types.h>
+
+#include <sys/cdefs.h>
+#include <sys/endian.h>
+
+#if (_BYTE_ORDER == _LITTLE_ENDIAN)
 #define TPM_BE16(a)	bswap16(a)
 #define TPM_BE32(a)	bswap32(a)
 #else
@@ -105,3 +113,5 @@ struct tpm_header {
  * Five localities, 4K per locality.
  */
 #define	TPM_SPACE_SIZE	0x5000
+
+#endif	/* DEV_IC_TPMREG_H */

Index: src/sys/dev/ic/tpmvar.h
diff -u src/sys/dev/ic/tpmvar.h:1.7 src/sys/dev/ic/tpmvar.h:1.8
--- src/sys/dev/ic/tpmvar.h:1.7	Wed Oct  9 14:03:58 2019
+++ src/sys/dev/ic/tpmvar.h	Mon Jan  4 18:22:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tpmvar.h,v 1.7 2019/10/09 14:03:58 maxv Exp $	*/
+/*	$NetBSD: tpmvar.h,v 1.8 2021/01/04 18:22:19 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -29,6 +29,11 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef	DEV_IC_TPMVAR_H
+#define	DEV_IC_TPMVAR_H
+
+#include <sys/types.h>
+
 #define TPM_API_VERSION		1
 
 enum tpm_version {
@@ -54,6 +59,10 @@ struct tpm_ioc_getinfo {
 
 #ifdef _KERNEL
 
+#include <sys/bus.h>
+#include <sys/device_if.h>
+#include <sys/mutex.h>
+
 struct tpm_softc;
 
 struct tpm_intf {
@@ -88,3 +97,5 @@ bool tpm_suspend(device_t, const pmf_qua
 bool tpm_resume(device_t, const pmf_qual_t *);
 
 #endif
+
+#endif	/* DEV_IC_TPMVAR_H */

Reply via email to