diff options
author | Joel Kitching <kitching@google.com> | 2019-08-20 17:43:50 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-08-28 07:32:05 +0000 |
commit | 9adf2aa24307937380debb703ac07b8093a25f61 (patch) | |
tree | b95c5bbb5259714ef86c125894267d0476cd62fe /firmware/lib | |
parent | a762fa782793e7b13ba13ceed474f20c54afbdd3 (diff) | |
download | vboot-9adf2aa24307937380debb703ac07b8093a25f61.tar.gz |
vboot: fix up some headers, includes, comments, spacing
BUG=b:124141368
TEST=make clean && make runtests
BRANCH=none
Change-Id: Id97f544da845f7070555e5e8cc6e782b2d45c300
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1758151
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'firmware/lib')
-rw-r--r-- | firmware/lib/cgptlib/include/cgptlib_internal.h | 2 | ||||
-rw-r--r-- | firmware/lib/cgptlib/include/crc32.h | 7 | ||||
-rw-r--r-- | firmware/lib/include/utility.h | 4 | ||||
-rw-r--r-- | firmware/lib/include/vboot_audio.h | 3 | ||||
-rw-r--r-- | firmware/lib/include/vboot_display.h | 3 | ||||
-rw-r--r-- | firmware/lib/include/vboot_ui_menu_private.h | 2 | ||||
-rw-r--r-- | firmware/lib/rollback_index.c | 2 | ||||
-rw-r--r-- | firmware/lib/tpm2_lite/marshaling.c | 3 | ||||
-rw-r--r-- | firmware/lib/tpm2_lite/tlcl.c | 8 | ||||
-rw-r--r-- | firmware/lib/tpm_lite/include/tlcl_internal.h | 6 | ||||
-rw-r--r-- | firmware/lib/tpm_lite/include/tpm_error_messages.h | 11 | ||||
-rw-r--r-- | firmware/lib/vboot_api_kernel.c | 2 | ||||
-rw-r--r-- | firmware/lib/vboot_kernel.c | 2 | ||||
-rw-r--r-- | firmware/lib/vboot_ui.c | 4 | ||||
-rw-r--r-- | firmware/lib/vboot_ui_common.c | 3 | ||||
-rw-r--r-- | firmware/lib/vboot_ui_menu.c | 2 |
16 files changed, 29 insertions, 35 deletions
diff --git a/firmware/lib/cgptlib/include/cgptlib_internal.h b/firmware/lib/cgptlib/include/cgptlib_internal.h index b9331b93..d58a35f6 100644 --- a/firmware/lib/cgptlib/include/cgptlib_internal.h +++ b/firmware/lib/cgptlib/include/cgptlib_internal.h @@ -166,4 +166,4 @@ const char *GptErrorText(int error_code); */ size_t CalculateEntriesSectors(GptHeader* h, uint32_t sector_bytes); -#endif /* VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_ */ +#endif /* VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_ */ diff --git a/firmware/lib/cgptlib/include/crc32.h b/firmware/lib/cgptlib/include/crc32.h index e2825ced..1f3e2a3d 100644 --- a/firmware/lib/cgptlib/include/crc32.h +++ b/firmware/lib/cgptlib/include/crc32.h @@ -2,11 +2,12 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -#ifndef VBOOT_REFERENCE_GPT_CRC32_H_ -#define VBOOT_REFERENCE_GPT_CRC32_H_ + +#ifndef VBOOT_REFERENCE_CRC32_H_ +#define VBOOT_REFERENCE_CRC32_H_ #include "2sysincludes.h" uint32_t Crc32(const void *buffer, uint32_t len); -#endif /* VBOOT_REFERENCE_GPT_CRC32_H_ */ +#endif /* VBOOT_REFERENCE_CRC32_H_ */ diff --git a/firmware/lib/include/utility.h b/firmware/lib/include/utility.h index 879950b1..cf39f16a 100644 --- a/firmware/lib/include/utility.h +++ b/firmware/lib/include/utility.h @@ -1,9 +1,7 @@ /* Copyright (c) 2013 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. - */ - -/* + * * Helper functions/wrappers for memory allocations, manipulation and * comparison. */ diff --git a/firmware/lib/include/vboot_audio.h b/firmware/lib/include/vboot_audio.h index 05f22f92..64cf0a78 100644 --- a/firmware/lib/include/vboot_audio.h +++ b/firmware/lib/include/vboot_audio.h @@ -20,5 +20,4 @@ void vb2_audio_start(struct vb2_context *ctx); */ int vb2_audio_looping(void); -#endif /* VBOOT_REFERENCE_VBOOT_AUDIO_H_ */ - +#endif /* VBOOT_REFERENCE_VBOOT_AUDIO_H_ */ diff --git a/firmware/lib/include/vboot_display.h b/firmware/lib/include/vboot_display.h index 6dfaeaa9..8621d860 100644 --- a/firmware/lib/include/vboot_display.h +++ b/firmware/lib/include/vboot_display.h @@ -22,5 +22,4 @@ vb2_error_t VbCheckDisplayKey(struct vb2_context *ctx, uint32_t key, */ const char *RecoveryReasonString(uint8_t code); -#endif /* VBOOT_REFERENCE_VBOOT_DISPLAY_H_ */ - +#endif /* VBOOT_REFERENCE_VBOOT_DISPLAY_H_ */ diff --git a/firmware/lib/include/vboot_ui_menu_private.h b/firmware/lib/include/vboot_ui_menu_private.h index b92fb5da..09688b48 100644 --- a/firmware/lib/include/vboot_ui_menu_private.h +++ b/firmware/lib/include/vboot_ui_menu_private.h @@ -90,4 +90,4 @@ typedef enum _VB_OPTIONS_MENU { VB_OPTIONS_COUNT, } VB_OPTIONS_MENU; -#endif +#endif /* VBOOT_REFERENCE_VBOOT_UI_MENU_PRIVATE_H_ */ diff --git a/firmware/lib/rollback_index.c b/firmware/lib/rollback_index.c index b4b49fab..c04a282d 100644 --- a/firmware/lib/rollback_index.c +++ b/firmware/lib/rollback_index.c @@ -31,7 +31,7 @@ uint32_t WriteSpaceKernel(RollbackSpaceKernel *rsk); /* * Compiling for unit test, so we need the real implementations of * rollback functions. The unit test mocks the underlying tlcl - * functions, so this is ok to run on the host. + * functions, so this is okay to run on the host. */ #undef CHROMEOS_ENVIRONMENT #undef DISABLE_ROLLBACK_TPM diff --git a/firmware/lib/tpm2_lite/marshaling.c b/firmware/lib/tpm2_lite/marshaling.c index 1a3e84a2..fb1b8022 100644 --- a/firmware/lib/tpm2_lite/marshaling.c +++ b/firmware/lib/tpm2_lite/marshaling.c @@ -1,5 +1,4 @@ -/* - * Copyright 2016 The Chromium OS Authors. All rights reserved. +/* Copyright 2016 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ diff --git a/firmware/lib/tpm2_lite/tlcl.c b/firmware/lib/tpm2_lite/tlcl.c index 9e6bc49f..02d1a91b 100644 --- a/firmware/lib/tpm2_lite/tlcl.c +++ b/firmware/lib/tpm2_lite/tlcl.c @@ -1,5 +1,4 @@ -/* - * Copyright 2016 The Chromium OS Authors. All rights reserved. +/* Copyright 2016 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * @@ -7,13 +6,12 @@ * in the firmware */ -#include "2sysincludes.h" #include "2common.h" - #include "rollback_index.h" +#include "2sysincludes.h" +#include "tlcl.h" #include "tpm2_marshaling.h" #include "utility.h" -#include "tlcl.h" /* Global buffer for deserialized responses. */ struct tpm2_response tpm2_resp; diff --git a/firmware/lib/tpm_lite/include/tlcl_internal.h b/firmware/lib/tpm_lite/include/tlcl_internal.h index 28eff1d9..98903990 100644 --- a/firmware/lib/tpm_lite/include/tlcl_internal.h +++ b/firmware/lib/tpm_lite/include/tlcl_internal.h @@ -3,8 +3,8 @@ * found in the LICENSE file. */ -#ifndef TPM_LITE_TLCL_INTERNAL_H_ -#define TPM_LITE_TLCL_INTERNAL_H_ +#ifndef VBOOT_REFERENCE_TLCL_INTERNAL_H_ +#define VBOOT_REFERENCE_TLCL_INTERNAL_H_ /* * These numbers derive from adding the sizes of command fields as shown in the @@ -84,4 +84,4 @@ static inline uint16_t ReadTpmUint16(const uint8_t **buffer) { return value; } -#endif /* TPM_LITE_TLCL_INTERNAL_H_ */ +#endif /* VBOOT_REFERENCE_TLCL_INTERNAL_H_ */ diff --git a/firmware/lib/tpm_lite/include/tpm_error_messages.h b/firmware/lib/tpm_lite/include/tpm_error_messages.h index 834ba2d0..ad2692c4 100644 --- a/firmware/lib/tpm_lite/include/tpm_error_messages.h +++ b/firmware/lib/tpm_lite/include/tpm_error_messages.h @@ -1,16 +1,15 @@ /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
- */
-
-/* TPM error codes.
+ *
+ * TPM error codes.
*
* Copy-pasted and lightly edited from TCG TPM Main Part 2 TPM Structures
* Version 1.2 Level 2 Revision 103 26 October 2006 Draft.
*/
-#ifndef TPM_ERROR_MESSAGES_H
-#define TPM_ERROR_MESSAGES_H
+#ifndef VBOOT_REFERENCE_TPM_ERROR_MESSAGES_H_
+#define VBOOT_REFERENCE_TPM_ERROR_MESSAGES_H_
#define TPM_E_BASE 0x0
#define TPM_E_NON_FATAL 0x800
@@ -247,4 +246,4 @@ because the ordinal required resources that have not been tested" }, time-out period" },
};
-#endif /* TPM_ERROR_MESSAGES_H */
+#endif /* VBOOT_REFERENCE_TPM_ERROR_MESSAGES_H_ */
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c index ae1df41e..621aa7fe 100644 --- a/firmware/lib/vboot_api_kernel.c +++ b/firmware/lib/vboot_api_kernel.c @@ -10,6 +10,8 @@ #include "2misc.h" #include "2nvstorage.h" #include "2rsa.h" +#include "2secdata.h" +#include "2sysincludes.h" #include "ec_sync.h" #include "load_kernel_fw.h" #include "rollback_index.h" diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c index 0d1545c9..1d54ef6f 100644 --- a/firmware/lib/vboot_kernel.c +++ b/firmware/lib/vboot_kernel.c @@ -6,12 +6,12 @@ * (Firmware portion) */ -#include "2sysincludes.h" #include "2common.h" #include "2misc.h" #include "2nvstorage.h" #include "2rsa.h" #include "2sha.h" +#include "2sysincludes.h" #include "cgptlib.h" #include "cgptlib_internal.h" #include "gpt_misc.h" diff --git a/firmware/lib/vboot_ui.c b/firmware/lib/vboot_ui.c index 88bbfb65..ee770ccd 100644 --- a/firmware/lib/vboot_ui.c +++ b/firmware/lib/vboot_ui.c @@ -531,9 +531,9 @@ static vb2_error_t vb2_developer_ui(struct vb2_context *ctx) /* Check if the default is to boot using disk, usb, or legacy */ uint32_t default_boot = vb2_nv_get(ctx, VB2_NV_DEV_DEFAULT_BOOT); - if(default_boot == VB2_DEV_DEFAULT_BOOT_USB) + if (default_boot == VB2_DEV_DEFAULT_BOOT_USB) use_usb = 1; - if(default_boot == VB2_DEV_DEFAULT_BOOT_LEGACY) + if (default_boot == VB2_DEV_DEFAULT_BOOT_LEGACY) use_legacy = 1; /* Handle GBB flag override */ diff --git a/firmware/lib/vboot_ui_common.c b/firmware/lib/vboot_ui_common.c index 09c96071..4255deb0 100644 --- a/firmware/lib/vboot_ui_common.c +++ b/firmware/lib/vboot_ui_common.c @@ -5,10 +5,9 @@ * High-level firmware wrapper API - user interface for RW firmware */ -#include "2sysincludes.h" #include "2common.h" - #include "rollback_index.h" +#include "2sysincludes.h" #include "vboot_api.h" #include "vboot_kernel.h" #include "vboot_ui_common.h" diff --git a/firmware/lib/vboot_ui_menu.c b/firmware/lib/vboot_ui_menu.c index 3c202c28..1b1db811 100644 --- a/firmware/lib/vboot_ui_menu.c +++ b/firmware/lib/vboot_ui_menu.c @@ -5,11 +5,11 @@ * High-level firmware wrapper API - user interface for RW firmware */ -#include "2sysincludes.h" #include "2common.h" #include "2misc.h" #include "2nvstorage.h" #include "2rsa.h" +#include "2sysincludes.h" #include "ec_sync.h" #include "load_kernel_fw.h" #include "rollback_index.h" |