summaryrefslogtreecommitdiff
path: root/include/ec_commands.h
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2019-01-15 12:20:40 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-01-19 00:14:07 -0800
commit3460c8658c13c639d8d5e3b9de2648757245664d (patch)
treef71dc7ba93edaafdc551c62073a1d04a508a0807 /include/ec_commands.h
parent683d56b24f45db76f198197f5c2687fcc80cdd58 (diff)
downloadchrome-ec-3460c8658c13c639d8d5e3b9de2648757245664d.tar.gz
ec_commands: Fix errors spotted by kernel checkpatch
To ease sync with kernel, fix errors found when merging ec_commands.h into kernel tree: - fix multiline comments - defined out BUILD_ASSERT, kernel has different macros for asserting at compilation time (BUILD_BUG_ON_...) can only be used within functions. BRANCH=none BUG=none TEST=Compile. Change-Id: I196a144e0d3392ffd12352b08d5bc9bda9b189ad Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1412641 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include/ec_commands.h')
-rw-r--r--include/ec_commands.h40
1 files changed, 27 insertions, 13 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 82e1dab1a6..27c8384d04 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -25,7 +25,9 @@ extern "C"{
#include "common.h"
#endif
-#if !defined(__KERNEL__)
+#ifdef __KERNEL__
+#define BUILD_ASSERT(_cond)
+#else
#include "compile_time_macros.h"
#endif
@@ -1386,15 +1388,19 @@ struct ec_response_flash_info {
uint32_t protect_block_size;
} __ec_align4;
-/* Flags for version 1+ flash info command */
-/* EC flash erases bits to 0 instead of 1 */
+/*
+ * Flags for version 1+ flash info command
+ * EC flash erases bits to 0 instead of 1.
+ */
#define EC_FLASH_INFO_ERASE_TO_0 (1 << 0)
-/* Flash must be selected for read/write/erase operations to succeed. This may
+/*
+ * Flash must be selected for read/write/erase operations to succeed. This may
* be necessary on a chip where write/erase can be corrupted by other board
* activity, or where the chip needs to enable some sort of programming voltage,
* or where the read/write/erase operations require cleanly suspending other
- * chip functionality. */
+ * chip functionality.
+ */
#define EC_FLASH_INFO_SELECT_REQUIRED (1 << 1)
/**
@@ -1661,8 +1667,10 @@ enum ec_flash_region {
/* Number of regions */
EC_FLASH_REGION_COUNT,
};
-/* 'RW' is vague if there are multiple RW images; we mean the active one,
- * so the old constant is deprecated */
+/*
+ * 'RW' is vague if there are multiple RW images; we mean the active one,
+ * so the old constant is deprecated.
+ */
#define EC_FLASH_REGION_RW EC_FLASH_REGION_ACTIVE
/**
@@ -2243,8 +2251,10 @@ enum ec_vboot_hash_status {
#define EC_VBOOT_HASH_OFFSET_ACTIVE 0xfffffffd
#define EC_VBOOT_HASH_OFFSET_UPDATE 0xfffffffc
-/* 'RW' is vague if there are multiple RW images; we mean the active one,
- * so the old constant is deprecated */
+/*
+ * 'RW' is vague if there are multiple RW images; we mean the active one,
+ * so the old constant is deprecated.
+ */
#define EC_VBOOT_HASH_OFFSET_RW EC_VBOOT_HASH_OFFSET_ACTIVE
/*****************************************************************************/
@@ -2558,8 +2568,10 @@ struct ec_params_motion_sense {
int16_t data;
} kb_wake_angle;
- /* Used for MOTIONSENSE_CMD_INFO, MOTIONSENSE_CMD_DATA
- * and MOTIONSENSE_CMD_PERFORM_CALIB. */
+ /*
+ * Used for MOTIONSENSE_CMD_INFO, MOTIONSENSE_CMD_DATA
+ * and MOTIONSENSE_CMD_PERFORM_CALIB.
+ */
struct __ec_todo_unpacked {
uint8_t sensor_num;
} info, info_3, data, fifo_flush, perform_calib,
@@ -4736,9 +4748,11 @@ struct ec_params_usb_pd_fw_update {
struct ec_params_usb_pd_rw_hash_entry {
uint16_t dev_id;
uint8_t dev_rw_hash[PD_RW_HASH_SIZE];
- uint8_t reserved; /* For alignment of current_image
+ uint8_t reserved; /*
+ * For alignment of current_image
* TODO(rspangler) but it's not aligned!
- * Should have been reserved[2]. */
+ * Should have been reserved[2].
+ */
uint32_t current_image; /* One of ec_current_image */
} __ec_align1;