diff options
author | Simon Glass <sjg@chromium.org> | 2023-08-24 13:55:34 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-08-25 17:55:18 -0400 |
commit | fbd644e7026f89f09cfa854fbf846449579f1684 (patch) | |
tree | bf8c7e81ca4e5233917ca37fc7b2cb3791ccf574 | |
parent | b2b7e6c1812d2b6bea517ea8f7df5c23ae04ce84 (diff) | |
download | u-boot-fbd644e7026f89f09cfa854fbf846449579f1684.tar.gz |
part: efi: Add debugging for the signature check
Add a little more debugging for the initial signature check. Drop the
pointless check for NULL. Also set a log category while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | disk/part_efi.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/disk/part_efi.c b/disk/part_efi.c index 20867521382..39382c5faee 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -9,6 +9,9 @@ * when CONFIG_SYS_64BIT_LBA is not defined, lbaint_t is 32 bits; this * limits the maximum size of addressable storage to < 2 tebibytes */ + +#define LOG_CATEGORY LOGC_FS + #include <common.h> #include <blk.h> #include <log.h> @@ -976,17 +979,23 @@ static int pmbr_part_valid(struct partition *part) /* * is_pmbr_valid(): test Protective MBR for validity * + * @mbr: Pointer to Master Boot-Record data + * * Returns: 1 if PMBR is valid, 0 otherwise. * Validity depends on two things: * 1) MSDOS signature is in the last two bytes of the MBR * 2) One partition of type 0xEE is found, checked by pmbr_part_valid() */ -static int is_pmbr_valid(legacy_mbr * mbr) +static int is_pmbr_valid(legacy_mbr *mbr) { + uint sig = le16_to_cpu(mbr->signature); int i = 0; - if (!mbr || le16_to_cpu(mbr->signature) != MSDOS_MBR_SIGNATURE) + if (sig != MSDOS_MBR_SIGNATURE) { + log_debug("Invalid signature %x\n", sig); return 0; + } + log_debug("Signature %x valid\n", sig); for (i = 0; i < 4; i++) { if (pmbr_part_valid(&mbr->partition_record[i])) { |