src/ec: Sanitize headers and comment #endif pairings

Comment #endif /* FOO */ pairings.
Alphabetise headers and remove any #if CONFIG_ guards around them.

Background rational:
Remove guarding the inclusion of headers based on CONFIG_ options. This
*potentially* could hide issues such as functions being swapped from
under our feet, since different runtime behaviour could be declared with
the same function same name and type-signature. Hence, depending on the
header we happen to get may change runtime behaviour.

Change-Id: Ic61bdfb64d99f0e2998c6451ae6686915b7bb3d4
Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-on: http://review.coreboot.org/6059
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
This commit is contained in:
Edward O'Callaghan 2014-06-17 20:13:08 +10:00 committed by Patrick Georgi
parent 0ddb82671c
commit b57fef9f3e
15 changed files with 33 additions and 34 deletions

View File

@ -49,5 +49,4 @@ void ec_set_bit(u8 addr, u8 bit);
void ec_clr_bit(u8 addr, u8 bit); void ec_clr_bit(u8 addr, u8 bit);
void ec_set_ports(u16 cmd_reg, u16 data_reg); void ec_set_ports(u16 cmd_reg, u16 data_reg);
#endif #endif /* _EC_ACPI_H */

View File

@ -24,12 +24,11 @@
#include <delay.h> #include <delay.h>
#include <arch/hlt.h> #include <arch/hlt.h>
#include <reset.h> #include <reset.h>
#ifndef __PRE_RAM__
#include <elog.h> #include <elog.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "chip.h" #include "chip.h"
#endif
#include "ec.h" #include "ec.h"
#include "ec_commands.h" #include "ec_commands.h"

View File

@ -23,6 +23,7 @@
#include <device/i2c.h> #include <device/i2c.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include "ec.h" #include "ec.h"
#include "ec_commands.h" #include "ec_commands.h"

View File

@ -17,14 +17,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <stdint.h>
#include <stdlib.h>
#include <console/console.h>
#include <arch/io.h> #include <arch/io.h>
#include <console/console.h>
#include <delay.h> #include <delay.h>
#include <device/pnp.h> #include <device/pnp.h>
#include <pc80/keyboard.h> #include <pc80/keyboard.h>
#include <stdint.h>
#include <stdlib.h>
#include "chip.h" #include "chip.h"
#include "ec.h" #include "ec.h"
#include "ec_commands.h" #include "ec_commands.h"

View File

@ -41,4 +41,4 @@ enum {
MSG_BYTES = EC_HOST_PARAM_SIZE + MSG_PROTO_BYTES, MSG_BYTES = EC_HOST_PARAM_SIZE + MSG_PROTO_BYTES,
}; };
#endif #endif /* _CROS_MESSAGE_H */

View File

@ -19,6 +19,7 @@
#include <console/console.h> #include <console/console.h>
#include <spi-generic.h> #include <spi-generic.h>
#include "ec.h" #include "ec.h"
#include "ec_commands.h" #include "ec_commands.h"

View File

@ -50,4 +50,5 @@ struct ec_lenovo_h8_config {
u8 has_keyboard_backlight; u8 has_keyboard_backlight;
u8 has_power_management_beeps; u8 has_power_management_beeps;
}; };
#endif
#endif /* EC_LENOVO_H8EC_CHIP_H */

View File

@ -20,14 +20,15 @@
#include <arch/io.h> #include <arch/io.h>
#include <console/console.h> #include <console/console.h>
#include <device/device.h> #include <device/device.h>
#include <ec/acpi/ec.h>
#include <device/pnp.h> #include <device/pnp.h>
#include <ec/acpi/ec.h>
#include <kconfig.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <pc80/mc146818rtc.h>
#include "h8.h" #include "h8.h"
#include "chip.h" #include "chip.h"
#include <pc80/mc146818rtc.h>
#include <string.h>
#include <kconfig.h>
static void h8_bluetooth_enable(int on) static void h8_bluetooth_enable(int on)
{ {

View File

@ -124,4 +124,5 @@ void h8_mainboard_init_dock (void);
#define H8_EVENT_FN_F5 0x64 #define H8_EVENT_FN_F5 0x64
#define H8_EVENT_FN_F6 0x65 #define H8_EVENT_FN_F6 0x65
#endif
#endif /* EC_LENOVO_H8_H */

View File

@ -24,4 +24,5 @@ struct ec_lenovo_pmh7_config {
int backlight_enable:1; int backlight_enable:1;
int dock_event_enable:1; int dock_event_enable:1;
}; };
#endif
#endif /* EC_LENOVO_PMH7_CHIP_H */

View File

@ -19,16 +19,13 @@
#include <arch/io.h> #include <arch/io.h>
#include <console/console.h> #include <console/console.h>
#ifndef __PRE_RAM__
#ifndef __SMM__
#include <device/device.h> #include <device/device.h>
#include <device/pnp.h> #include <device/pnp.h>
#endif
#endif
#include <stdlib.h> #include <stdlib.h>
#include <pc80/mc146818rtc.h>
#include "pmh7.h" #include "pmh7.h"
#include "chip.h" #include "chip.h"
#include <pc80/mc146818rtc.h>
void pmh7_backlight_enable(int onoff) void pmh7_backlight_enable(int onoff)
{ {

View File

@ -36,4 +36,5 @@ void pmh7_dock_event_enable(int onoff);
void pmh7_touchpad_enable(int onoff); void pmh7_touchpad_enable(int onoff);
void pmh7_ultrabay_power_enable(int onoff); void pmh7_ultrabay_power_enable(int onoff);
void pmh7_trackpoint_enable(int onoff); void pmh7_trackpoint_enable(int onoff);
#endif
#endif /* EC_LENOVO_PMH7_H */

View File

@ -21,14 +21,15 @@
#ifndef __PRE_RAM__ #ifndef __PRE_RAM__
#include <console/console.h>
#include <arch/io.h> #include <arch/io.h>
#include <console/console.h>
#include <device/device.h> #include <device/device.h>
#include <device/pnp.h> #include <device/pnp.h>
#include <stdlib.h>
#include <delay.h> #include <delay.h>
#include <elog.h> #include <elog.h>
#include <stdlib.h>
#include <pc80/keyboard.h> #include <pc80/keyboard.h>
#include "ec.h" #include "ec.h"
#include "chip.h" #include "chip.h"

View File

@ -19,19 +19,14 @@
* MA 02110-1301 USA * MA 02110-1301 USA
*/ */
#include <arch/io.h>
#include <console/console.h> #include <console/console.h>
#include <pc80/keyboard.h> #include <delay.h>
#ifndef __PRE_RAM__
#include <device/device.h> #include <device/device.h>
#include <device/pnp.h> #include <device/pnp.h>
#endif #include <pc80/keyboard.h>
#include <stdlib.h> #include <stdlib.h>
#include <arch/io.h>
#include <delay.h>
#include "ec.h" #include "ec.h"
#include "chip.h" #include "chip.h"

View File

@ -19,10 +19,11 @@
* MA 02110-1301 USA * MA 02110-1301 USA
*/ */
#include <arch/io.h>
#include <console/console.h> #include <console/console.h>
#include <device/device.h> #include <device/device.h>
#include <arch/io.h>
#include <delay.h> #include <delay.h>
#include "ec.h" #include "ec.h"
#include "chip.h" #include "chip.h"