summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2021-02-13 12:01:47 -0500
committerJavier Martinez Canillas <javier@dowhile0.org>2021-02-16 16:42:27 +0100
commit0bc2aa4ca81d8a022ce37ab3eb295836fb18258b (patch)
treef3f8398ca6e63211df7621608137c0249b6405c1
parent4edb31fcfc12dc0627edf8018f3a179dffe634a1 (diff)
downloadefi-boot-shim-0bc2aa4ca81d8a022ce37ab3eb295836fb18258b.tar.gz
efi-boot-shim-0bc2aa4ca81d8a022ce37ab3eb295836fb18258b.zip
sbat: clang-format the whole thing.
Signed-off-by: Peter Jones <pjones@redhat.com>
-rw-r--r--include/sbat.h2
-rw-r--r--sbat.c50
2 files changed, 27 insertions, 25 deletions
diff --git a/include/sbat.h b/include/sbat.h
index 39971d9e..5f0d7643 100644
--- a/include/sbat.h
+++ b/include/sbat.h
@@ -21,7 +21,7 @@ struct sbat {
};
EFI_STATUS parse_sbat(char *sbat_base, size_t sbat_size, char *buffer,
- struct sbat *sbat);
+ struct sbat *sbat);
#endif /* !SBAT_H_ */
// vim:fenc=utf-8:tw=75:noet
diff --git a/sbat.c b/sbat.c
index 3eaecdb8..96c43cc8 100644
--- a/sbat.c
+++ b/sbat.c
@@ -6,25 +6,25 @@
#include "shim.h"
CHAR8 *
-get_sbat_field(CHAR8 *current, CHAR8 *end, const CHAR8 ** field, char delim)
+get_sbat_field(CHAR8 *current, CHAR8 *end, const CHAR8 **field, char delim)
{
- CHAR8 *offset;
+ CHAR8 *offset;
- if (!field || !current || !end || current >= end)
- return NULL;
+ if (!field || !current || !end || current >= end)
+ return NULL;
- offset = strchrnula(current, delim);
- *field = current;
+ offset = strchrnula(current, delim);
+ *field = current;
- if (!*offset)
- return NULL;
+ if (!*offset)
+ return NULL;
- *offset = '\0';
- return offset + 1;
+ *offset = '\0';
+ return offset + 1;
}
-EFI_STATUS parse_sbat_entry(CHAR8 **current, CHAR8 *end,
- struct sbat_entry **sbat_entry)
+EFI_STATUS
+parse_sbat_entry(CHAR8 **current, CHAR8 *end, struct sbat_entry **sbat_entry)
{
struct sbat_entry *entry = NULL;
@@ -36,23 +36,25 @@ EFI_STATUS parse_sbat_entry(CHAR8 **current, CHAR8 *end,
if (!entry->component_name)
goto error;
- *current = get_sbat_field(*current, end, &entry->component_generation,',');
+ *current = get_sbat_field(*current, end, &entry->component_generation,
+ ',');
if (!entry->component_generation)
goto error;
- *current = get_sbat_field(*current, end, &entry->vendor_name,',');
+ *current = get_sbat_field(*current, end, &entry->vendor_name, ',');
if (!entry->vendor_name)
goto error;
- *current = get_sbat_field(*current, end, &entry->vendor_package_name, ',');
+ *current =
+ get_sbat_field(*current, end, &entry->vendor_package_name, ',');
if (!entry->vendor_package_name)
goto error;
- *current = get_sbat_field(*current, end, &entry->vendor_version,',');
+ *current = get_sbat_field(*current, end, &entry->vendor_version, ',');
if (!entry->vendor_version)
goto error;
- *current = get_sbat_field(*current, end, &entry->vendor_url,'\n');
+ *current = get_sbat_field(*current, end, &entry->vendor_url, '\n');
if (!entry->vendor_url)
goto error;
@@ -65,11 +67,11 @@ error:
return EFI_INVALID_PARAMETER;
}
-EFI_STATUS parse_sbat(char *sbat_base, size_t sbat_size, char *buffer,
- struct sbat *sbat)
+EFI_STATUS
+parse_sbat(char *sbat_base, size_t sbat_size, char *buffer, struct sbat *sbat)
{
- CHAR8 *current = (CHAR8 *) sbat_base;
- CHAR8 *end = (CHAR8 *) sbat_base + sbat_size;
+ CHAR8 *current = (CHAR8 *)sbat_base;
+ CHAR8 *end = (CHAR8 *)sbat_base + sbat_size;
EFI_STATUS efi_status = EFI_SUCCESS;
struct sbat_entry *entry;
struct sbat_entry **entries;
@@ -98,9 +100,9 @@ EFI_STATUS parse_sbat(char *sbat_base, size_t sbat_size, char *buffer,
}
if (entry) {
- entries = ReallocatePool(sbat->entries,
- sbat->size * sizeof(entry),
- (sbat->size + 1) * sizeof(entry));
+ entries = ReallocatePool(
+ sbat->entries, sbat->size * sizeof(entry),
+ (sbat->size + 1) * sizeof(entry));
if (!entries) {
efi_status = EFI_OUT_OF_RESOURCES;
goto error;