[coreboot-gerrit] Patch set updated for coreboot: src/include: Open brace on same line as enum or struct

Lee Leahy (leroy.p.leahy@intel.com) gerrit at coreboot.org
Wed Mar 8 20:06:18 CET 2017


Lee Leahy (leroy.p.leahy at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18653

-gerrit

commit f43ae98c420af38e1f216627ab4c42684f958b14
Author: Lee Leahy <leroy.p.leahy at intel.com>
Date:   Tue Mar 7 15:11:07 2017 -0800

    src/include: Open brace on same line as enum or struct
    
    Fix the following errors and warning detected by checkpatch.pl:
    
    ERROR: open brace '{' following enum go on the same line
    ERROR: open brace '{' following struct go on the same line
    ERROR: that open brace { should be on the previous line
    WARNING: missing space after struct definition
    
    TEST=Build and run on Galileo Gen2
    
    Change-Id: I856235d0cc3a3e59376df52561b17b872b3416b2
    Signed-off-by: Lee Leahy <Leroy.P.Leahy at intel.com>
---
 src/include/cpu/x86/msr.h            |  6 ++----
 src/include/device/i2c.h             | 15 +++++++++------
 src/include/device/path.h            | 33 +++++++++++----------------------
 src/include/rtc.h                    |  3 +--
 src/include/smbios.h                 |  3 +--
 src/include/tpm_lite/tss_constants.h |  5 ++---
 6 files changed, 26 insertions(+), 39 deletions(-)

diff --git a/src/include/cpu/x86/msr.h b/src/include/cpu/x86/msr.h
index c663d29..1175f3b 100644
--- a/src/include/cpu/x86/msr.h
+++ b/src/include/cpu/x86/msr.h
@@ -17,14 +17,12 @@ static void wrmsr(unsigned long index, msr_t msr)
 
 #else
 
-typedef struct msr_struct
-{
+typedef struct msr_struct {
 	unsigned int lo;
 	unsigned int hi;
 } msr_t;
 
-typedef struct msrinit_struct
-{
+typedef struct msrinit_struct {
 	unsigned int index;
 	msr_t msr;
 } msrinit_t;
diff --git a/src/include/device/i2c.h b/src/include/device/i2c.h
index b3a5cca..6115bd1 100644
--- a/src/include/device/i2c.h
+++ b/src/include/device/i2c.h
@@ -32,8 +32,7 @@ enum i2c_address_mode {
 	I2C_MODE_10_BIT
 };
 
-struct i2c_seg
-{
+struct i2c_seg {
 	int read;
 	uint8_t chip;
 	uint8_t *buf;
@@ -89,8 +88,10 @@ static inline int i2c_transfer(unsigned int bus, struct i2c_seg *segments,
 static inline int i2c_read_raw(unsigned int bus, uint8_t chip, uint8_t *data,
 			       int len)
 {
-	struct i2c_seg seg =
-		{ .read = 1, .chip = chip, .buf = data, .len = len };
+	struct i2c_seg seg = {
+		.read = 1, .chip = chip, .buf = data, .len = len
+	};
+
 	return i2c_transfer(bus, &seg, 1);
 }
 
@@ -102,8 +103,10 @@ static inline int i2c_read_raw(unsigned int bus, uint8_t chip, uint8_t *data,
 static inline int i2c_write_raw(unsigned int bus, uint8_t chip, uint8_t *data,
 				int len)
 {
-	struct i2c_seg seg =
-		{ .read = 0, .chip = chip, .buf = data, .len = len };
+	struct i2c_seg seg = {
+		.read = 0, .chip = chip, .buf = data, .len = len
+	};
+
 	return i2c_transfer(bus, &seg, 1);
 }
 
diff --git a/src/include/device/path.h b/src/include/device/path.h
index 1eaa32f..5109fda 100644
--- a/src/include/device/path.h
+++ b/src/include/device/path.h
@@ -38,35 +38,29 @@ enum device_path_type {
 		"DEVICE_PATH_SPI",		\
 }
 
-struct domain_path
-{
+struct domain_path {
 	unsigned int domain;
 };
 
-struct pci_path
-{
+struct pci_path {
 	unsigned int devfn;
 };
 
-struct pnp_path
-{
+struct pnp_path {
 	unsigned int port;
 	unsigned int device;
 };
 
-struct i2c_path
-{
+struct i2c_path {
 	unsigned int device;
 	unsigned int mode_10bit;
 };
 
-struct spi_path
-{
+struct spi_path {
 	unsigned int cs;
 };
 
-struct apic_path
-{
+struct apic_path {
 	unsigned int apic_id;
 	unsigned int package_id;
 	unsigned int node_id;
@@ -74,28 +68,23 @@ struct apic_path
 	unsigned int thread_id;
 };
 
-struct ioapic_path
-{
+struct ioapic_path {
 	unsigned int ioapic_id;
 };
 
-struct cpu_cluster_path
-{
+struct cpu_cluster_path {
 	unsigned int cluster;
 };
 
-struct cpu_path
-{
+struct cpu_path {
 	unsigned int id;
 };
 
-struct cpu_bus_path
-{
+struct cpu_bus_path {
 	unsigned int id;
 };
 
-struct generic_path
-{
+struct generic_path {
 	unsigned int id;
 	unsigned int subid;
 };
diff --git a/src/include/rtc.h b/src/include/rtc.h
index e654785..f006e7a 100644
--- a/src/include/rtc.h
+++ b/src/include/rtc.h
@@ -16,8 +16,7 @@
 #ifndef _RTC_H_
 #define _RTC_H_
 
-struct rtc_time
-{
+struct rtc_time {
 	int sec;
 	int min;
 	int hour;
diff --git a/src/include/smbios.h b/src/include/smbios.h
index 785ceec..96d9bea 100644
--- a/src/include/smbios.h
+++ b/src/include/smbios.h
@@ -276,8 +276,7 @@ struct smbios_type2 {
 	char eos[2];
 } __attribute__((packed));
 
-enum
-{
+enum {
 	SMBIOS_ENCLOSURE_DESKTOP = 3,
 	SMBIOS_ENCLOSURE_NOTEBOOK = 9,
 };
diff --git a/src/include/tpm_lite/tss_constants.h b/src/include/tpm_lite/tss_constants.h
index eda7d6b..937e553 100644
--- a/src/include/tpm_lite/tss_constants.h
+++ b/src/include/tpm_lite/tss_constants.h
@@ -64,8 +64,7 @@
 typedef uint8_t TSS_BOOL;
 typedef uint16_t TPM_STRUCTURE_TAG;
 
-typedef struct tdTPM_PERMANENT_FLAGS
-{
+typedef struct tdTPM_PERMANENT_FLAGS {
 	TPM_STRUCTURE_TAG tag;
 	TSS_BOOL disable;
 	TSS_BOOL ownership;
@@ -89,7 +88,7 @@ typedef struct tdTPM_PERMANENT_FLAGS
 	TSS_BOOL disableFullDALogicInfo;
 } TPM_PERMANENT_FLAGS;
 
-typedef struct tdTPM_STCLEAR_FLAGS{
+typedef struct tdTPM_STCLEAR_FLAGS {
 	TPM_STRUCTURE_TAG tag;
 	TSS_BOOL deactivated;
 	TSS_BOOL disableForceClear;



More information about the coreboot-gerrit mailing list