mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-08-17 17:17:47 +00:00
sbat: clang-format the whole thing.
Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
parent
4edb31fcfc
commit
0bc2aa4ca8
30
sbat.c
30
sbat.c
@ -6,7 +6,7 @@
|
|||||||
#include "shim.h"
|
#include "shim.h"
|
||||||
|
|
||||||
CHAR8 *
|
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;
|
||||||
|
|
||||||
@ -23,8 +23,8 @@ get_sbat_field(CHAR8 *current, CHAR8 *end, const CHAR8 ** field, char delim)
|
|||||||
return offset + 1;
|
return offset + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS parse_sbat_entry(CHAR8 **current, CHAR8 *end,
|
EFI_STATUS
|
||||||
struct sbat_entry **sbat_entry)
|
parse_sbat_entry(CHAR8 **current, CHAR8 *end, struct sbat_entry **sbat_entry)
|
||||||
{
|
{
|
||||||
struct sbat_entry *entry = NULL;
|
struct sbat_entry *entry = NULL;
|
||||||
|
|
||||||
@ -36,23 +36,25 @@ EFI_STATUS parse_sbat_entry(CHAR8 **current, CHAR8 *end,
|
|||||||
if (!entry->component_name)
|
if (!entry->component_name)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
*current = get_sbat_field(*current, end, &entry->component_generation,',');
|
*current = get_sbat_field(*current, end, &entry->component_generation,
|
||||||
|
',');
|
||||||
if (!entry->component_generation)
|
if (!entry->component_generation)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
*current = get_sbat_field(*current, end, &entry->vendor_name,',');
|
*current = get_sbat_field(*current, end, &entry->vendor_name, ',');
|
||||||
if (!entry->vendor_name)
|
if (!entry->vendor_name)
|
||||||
goto error;
|
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)
|
if (!entry->vendor_package_name)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
*current = get_sbat_field(*current, end, &entry->vendor_version,',');
|
*current = get_sbat_field(*current, end, &entry->vendor_version, ',');
|
||||||
if (!entry->vendor_version)
|
if (!entry->vendor_version)
|
||||||
goto error;
|
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)
|
if (!entry->vendor_url)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
@ -65,11 +67,11 @@ error:
|
|||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS parse_sbat(char *sbat_base, size_t sbat_size, char *buffer,
|
EFI_STATUS
|
||||||
struct sbat *sbat)
|
parse_sbat(char *sbat_base, size_t sbat_size, char *buffer, struct sbat *sbat)
|
||||||
{
|
{
|
||||||
CHAR8 *current = (CHAR8 *) sbat_base;
|
CHAR8 *current = (CHAR8 *)sbat_base;
|
||||||
CHAR8 *end = (CHAR8 *) sbat_base + sbat_size;
|
CHAR8 *end = (CHAR8 *)sbat_base + sbat_size;
|
||||||
EFI_STATUS efi_status = EFI_SUCCESS;
|
EFI_STATUS efi_status = EFI_SUCCESS;
|
||||||
struct sbat_entry *entry;
|
struct sbat_entry *entry;
|
||||||
struct sbat_entry **entries;
|
struct sbat_entry **entries;
|
||||||
@ -98,8 +100,8 @@ EFI_STATUS parse_sbat(char *sbat_base, size_t sbat_size, char *buffer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (entry) {
|
if (entry) {
|
||||||
entries = ReallocatePool(sbat->entries,
|
entries = ReallocatePool(
|
||||||
sbat->size * sizeof(entry),
|
sbat->entries, sbat->size * sizeof(entry),
|
||||||
(sbat->size + 1) * sizeof(entry));
|
(sbat->size + 1) * sizeof(entry));
|
||||||
if (!entries) {
|
if (!entries) {
|
||||||
efi_status = EFI_OUT_OF_RESOURCES;
|
efi_status = EFI_OUT_OF_RESOURCES;
|
||||||
|
Loading…
Reference in New Issue
Block a user