Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AEA3BC32771 for ; Mon, 26 Sep 2022 06:11:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3957E84C5B; Mon, 26 Sep 2022 08:11:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="YOj76qoj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2576484C69; Mon, 26 Sep 2022 08:11:39 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A3FDD848E3 for ; Mon, 26 Sep 2022 08:11:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1664172693; bh=Qh94eZO/cTiV9mOZ7x9Bu16iDsVH+m+sC69G7sq3VM0=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=YOj76qojrazhOkbO28mLIpmJEycdpIs7rbJeieOoN4ju5IWHwrRWwPLQogo7BFxF+ KtJNCplVnVKfW236DtWxdGzv9iHVgM1r7jcWHUu1ZpVC5IjoG3MAvriDBRFP7SeBwM flMSevM8Zjg2t4RIivbF9kJ8x+usCLOIFn5i/3R4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.94] ([84.118.157.2]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MbzyP-1pFcSY1YCd-00dXPT; Mon, 26 Sep 2022 08:11:33 +0200 Message-ID: Date: Mon, 26 Sep 2022 08:11:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH 02/45] disk: Drop debug messages in part_efi Content-Language: en-US To: Simon Glass Cc: Tom Rini , Philippe Reynes , U-Boot Mailing List References: <20220925150248.2524421-1-sjg@chromium.org> <20220925150248.2524421-3-sjg@chromium.org> From: Heinrich Schuchardt In-Reply-To: <20220925150248.2524421-3-sjg@chromium.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ipILDGMESjHDjjV36TW0KMH8ygRRHkxBx7URovxvdjuRk/FML6P giel/yG6axLwKa94tmPU5Q6ksuZlO8yh6f3hCOG1pdZSLZy9LR6OTIFTrjKX1V1+5gJkxy8 oHWjisBVdJSdmZM+s0+o6aRsve/CfuCgLEIk5lUpOi09ZJefJwRDSGz6qw9f2X938E5c8Gs mMjzphDM7GZhVNbu9os8A== X-UI-Out-Filterresults: notjunk:1;V03:K0:D/TD1m824Sw=:JSPvUVoL9vH4s43cTsvVWa wDYMQcP4pkXqUCuG8b1geio0KoGgKC1kVT8KQh44SpClwOs/1g84WlEvFsBwm2YOAkJhAWcFV JNzXlp6o+PMnv9jZWvRz1AajdUDgZhWEQbVpygcvjZriBnDzh3flqYhe+b1XRzRivNTA8SZaE 0eMZwT5BzhQJI7nTW6iwiV41MDCJr5Ez/wzjBlYv4ByXWkv4+c9VgyV49DNAcBlw/KubQNfPI KBqlCRBFVqxKv4qWtw1bdG8LC9CxNrnG4K2Vmr9im0O2rDvXC7BxOGao14JzQ1n4u0S2Z7r4s YNO9C0kv1oL7VdiWmNYhXNtFEz+ff4r85/Qsl3Tf7xHr9l1qI8XulyqpNuLH0JJp3ggMaljZx gJBbzcFVSLDmZvUqXCXX1f0bvqYT2WnB2XUh9nrWloBN6D0//ZUx6iTWD7tkHbjbZFP81fwdp e6hFzcnM0/+OaIBd97RKWt8zWgHWFhjV9BPwk8+QJz2+7YX47dJgQDByDIwmEIRD+8vnWgp7J L0Xn5ZEJ/m9FvkI8ck/x1pqVfQvFicyQ2GufnFnuBJzUWcLbJRGTfQV60GCQC8ax+r2VDYLSb z8S37c/+uGdKGwHCtfTzY33LqCxsY254vdYaUyTeKg/9OEqKU81OmmEy6NylEZ3qqfQkoZbbc yRHqBb1l+8gtNtf5SXRoPq6yoplAvDz1fiXxPcHOeTqdh1KUmU4FW8ykEQtcKZ3bNdfJlcZZ4 DhfafxEm049R2DKrb0pXsxp+kT7CYuc9Ax8oOot9wS+iEMPlXz2FZOFH+ZIU+4BIzZBvBIYQ1 Y0BwGPHYHR0Y8YxX0E3c6YKAB8K1hZumAwlz7bTVW36DZHYOmH+VnvocoKhduffamlzbn4dS8 s6mDZ0DuSJYG6d2Fspj6F74QKF1Xx+z2/gLIkFFF7X+vIYE9v8fCEg1qZQNkaYDECRL7xEDqa 0phDof/QVwaQ1H2fC4iy3TcmgWpIKYT3/VfGpBb3wYbgIgAyQXMSFJO/drNnQ59MqKPbp4hlK aW745sWP4Np78cUgT8aPVlPlIapH+cPXaj9QPLhZZkjwQTriszhR4amfQwCct4QWqx+Hzg3pl 0EDD1dLx5qCvhiZ4A0Nqw2odGvFZqPPv/EFtDhYkD2SBE4nDwXvsprpFGm+cLqNb5NV0Mukn7 eB1pgaYQRi7cmthgFDsSUWgFoT X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On 9/25/22 17:02, Simon Glass wrote: > This is monstrously verbose when something goes wrong. It should work by > recording the problem and reporting it (once) at the command level. At > present it sometimes outputs hundreds of lines of CRC mismatches. > > For now, just silence it all. > > GUID Partition Table Entry Array CRC is wrong: 0xaebfebf2 !=3D 0xc916= f712 > find_valid_gpt: *** ERROR: Invalid GPT *** > find_valid_gpt: *** Using Backup GPT *** > GUID Partition Table Entry Array CRC is wrong: 0xaebfebf2 !=3D 0xc916= f712 > find_valid_gpt: *** ERROR: Invalid GPT *** > find_valid_gpt: *** Using Backup GPT *** > ... > > Signed-off-by: Simon Glass > --- > > disk/part_efi.c | 148 +++++++++++++++++++++++------------------------- > 1 file changed, 71 insertions(+), 77 deletions(-) > > diff --git a/disk/part_efi.c b/disk/part_efi.c > index 26738a57d5d..1a359066ae9 100644 > --- a/disk/part_efi.c > +++ b/disk/part_efi.c > @@ -94,10 +94,10 @@ static int validate_gpt_header(gpt_header *gpt_h, lb= aint_t lba, > > /* Check the GPT header signature */ > if (le64_to_cpu(gpt_h->signature) !=3D GPT_HEADER_SIGNATURE_UBOOT) { > - printf("%s signature is wrong: 0x%llX !=3D 0x%llX\n", > - "GUID Partition Table Header", > - le64_to_cpu(gpt_h->signature), > - GPT_HEADER_SIGNATURE_UBOOT); > + log_debug("%s signature is wrong: %#llX !=3D %#llX\n", > + "GUID Partition Table Header", > + le64_to_cpu(gpt_h->signature), > + GPT_HEADER_SIGNATURE_UBOOT); > return -1; > } > > @@ -111,9 +111,9 @@ static int validate_gpt_header(gpt_header *gpt_h, lb= aint_t lba, > memcpy(&gpt_h->header_crc32, &crc32_backup, sizeof(crc32_backup)); > > if (calc_crc32 !=3D le32_to_cpu(crc32_backup)) { > - printf("%s CRC is wrong: 0x%x !=3D 0x%x\n", > - "GUID Partition Table Header", > - le32_to_cpu(crc32_backup), calc_crc32); > + log_debug("%s: CRC is wrong: %#x !=3D %#x\n", > + "GUID Partition Table Header", > + le32_to_cpu(crc32_backup), calc_crc32); > return -1; > } > > @@ -121,9 +121,8 @@ static int validate_gpt_header(gpt_header *gpt_h, lb= aint_t lba, > * Check that the my_lba entry points to the LBA that contains the GP= T > */ > if (le64_to_cpu(gpt_h->my_lba) !=3D lba) { > - printf("GPT: my_lba incorrect: %llX !=3D " LBAF "\n", > - le64_to_cpu(gpt_h->my_lba), > - lba); > + log_debug("GPT: my_lba incorrect: %llX !=3D " LBAF "\n", > + le64_to_cpu(gpt_h->my_lba), lba); > return -1; > } > > @@ -132,13 +131,13 @@ static int validate_gpt_header(gpt_header *gpt_h, = lbaint_t lba, > * within the disk. > */ > if (le64_to_cpu(gpt_h->first_usable_lba) > lastlba) { > - printf("GPT: first_usable_lba incorrect: %llX > " LBAF "\n", > - le64_to_cpu(gpt_h->first_usable_lba), lastlba); > + log_debug("GPT: first_usable_lba incorrect: %llX > " LBAF "\n", > + le64_to_cpu(gpt_h->first_usable_lba), lastlba); > return -1; > } > if (le64_to_cpu(gpt_h->last_usable_lba) > lastlba) { > - printf("GPT: last_usable_lba incorrect: %llX > " LBAF "\n", > - le64_to_cpu(gpt_h->last_usable_lba), lastlba); > + log_debug("GPT: last_usable_lba incorrect: %llX > " LBAF "\n", > + le64_to_cpu(gpt_h->last_usable_lba), lastlba); > return -1; > } > > @@ -159,10 +158,10 @@ static int validate_gpt_entries(gpt_header *gpt_h,= gpt_entry *gpt_e) > le32_to_cpu(gpt_h->sizeof_partition_entry)); > > if (calc_crc32 !=3D le32_to_cpu(gpt_h->partition_entry_array_crc32)) = { > - printf("%s: 0x%x !=3D 0x%x\n", > - "GUID Partition Table Entry Array CRC is wrong", > - le32_to_cpu(gpt_h->partition_entry_array_crc32), > - calc_crc32); > + log_debug("%s: %#x !=3D %#x\n", > + "GUID Partition Table Entry Array CRC is wrong", > + le32_to_cpu(gpt_h->partition_entry_array_crc32), > + calc_crc32); > return -1; > } > > @@ -330,14 +329,15 @@ static int set_protective_mbr(struct blk_desc *dev= _desc) > /* Setup the Protective MBR */ > ALLOC_CACHE_ALIGN_BUFFER_PAD(legacy_mbr, p_mbr, 1, dev_desc->blksz); > if (p_mbr =3D=3D NULL) { > - printf("%s: calloc failed!\n", __func__); > - return -1; > + log_debug("calloc failed!\n"); > + return -ENOMEM; > } > > /* Read MBR to backup boot code if it exists */ > if (blk_dread(dev_desc, 0, 1, p_mbr) !=3D 1) { > - pr_err("** Can't read from device %d **\n", dev_desc->devnum); > - return -1; > + log_debug("** Can't read from device %d **\n", > + dev_desc->devnum); > + return -EIO; > } > > /* Clear all data in MBR except of backed up boot code */ > @@ -352,9 +352,8 @@ static int set_protective_mbr(struct blk_desc *dev_d= esc) > > /* Write MBR sector to the MMC device */ > if (blk_dwrite(dev_desc, 0, 1, p_mbr) !=3D 1) { > - printf("** Can't write to device %d **\n", > - dev_desc->devnum); > - return -1; > + log_debug("** Can't write to device %d **\n", dev_desc->devnum); > + return -EIO; > } > > return 0; > @@ -404,8 +403,8 @@ int write_gpt_table(struct blk_desc *dev_desc, > return 0; > > err: > - printf("** Can't write to device %d **\n", dev_desc->devnum); > - return -1; > + log_debug("** Can't write to device %d **\n", dev_desc->devnum); > + return -EIO; > } > > int gpt_fill_pte(struct blk_desc *dev_desc, > @@ -451,15 +450,15 @@ int gpt_fill_pte(struct blk_desc *dev_desc, > */ > if (((start < hdr_end && hdr_start < (start + size)) || > (start < pte_end && pte_start < (start + size)))) { > - printf("Partition overlap\n"); > - return -1; > + log_debug("Partition overlap\n"); > + return -ENOSPC; > } > > gpt_e[i].starting_lba =3D cpu_to_le64(start); > > if (offset > (last_usable_lba + 1)) { > - printf("Partitions layout exceds disk size\n"); > - return -1; > + log_debug("Partitions layout exceeds disk size\n"); > + return -E2BIG; > } > /* partition ending lba */ > if ((i =3D=3D parts - 1) && (size =3D=3D 0)) > @@ -474,9 +473,9 @@ int gpt_fill_pte(struct blk_desc *dev_desc, > if (strlen(str_type_guid)) { > if (uuid_str_to_bin(str_type_guid, bin_type_guid, > UUID_STR_FORMAT_GUID)) { > - printf("Partition no. %d: invalid type guid: %s\n", > - i, str_type_guid); > - return -1; > + log_debug("Partition no. %d: invalid type guid: %s\n", > + i, str_type_guid); > + return -EINVAL; > } > } else { > /* default partition type GUID */ > @@ -494,9 +493,9 @@ int gpt_fill_pte(struct blk_desc *dev_desc, > bin_uuid =3D gpt_e[i].unique_partition_guid.b; > > if (uuid_str_to_bin(str_uuid, bin_uuid, UUID_STR_FORMAT_GUID)) { > - printf("Partition no. %d: invalid guid: %s\n", > - i, str_uuid); > - return -1; > + log_debug("Partition no. %d: invalid guid: %s\n", > + i, str_uuid); > + return -EINVAL; > } > #endif > > @@ -608,8 +607,8 @@ int gpt_restore(struct blk_desc *dev_desc, char *str= _disk_guid, > size =3D PAD_TO_BLOCKSIZE(sizeof(gpt_header), dev_desc); > gpt_h =3D malloc_cache_aligned(size); > if (gpt_h =3D=3D NULL) { > - printf("%s: calloc failed!\n", __func__); > - return -1; > + log_debug("calloc failed!\n"); > + return -ENOMEM; > } > memset(gpt_h, 0, size); > > @@ -617,9 +616,9 @@ int gpt_restore(struct blk_desc *dev_desc, char *str= _disk_guid, > dev_desc); > gpt_e =3D malloc_cache_aligned(size); > if (gpt_e =3D=3D NULL) { > - printf("%s: calloc failed!\n", __func__); > + log_debug("calloc failed!\n"); > free(gpt_h); > - return -1; > + return -ENOMEM; > } > memset(gpt_e, 0, size); > > @@ -675,8 +674,7 @@ int gpt_verify_headers(struct blk_desc *dev_desc, gp= t_header *gpt_head, > if (is_gpt_valid(dev_desc, > GPT_PRIMARY_PARTITION_TABLE_LBA, > gpt_head, gpt_pte) !=3D 1) { > - printf("%s: *** ERROR: Invalid GPT ***\n", > - __func__); > + log_debug("*** ERROR: Invalid GPT ***\n"); Silencing the messages during partition probing looks ok to me. Can we get rid of all these '*** ERROR: '? The message texts already indicate that an unexpected situation occurred. Best regards Heinrich > return -1; > } > > @@ -687,15 +685,13 @@ int gpt_verify_headers(struct blk_desc *dev_desc, = gpt_header *gpt_head, > * Check that the alternate_lba entry points to the last LBA > */ > if (le64_to_cpu(gpt_head->alternate_lba) !=3D (dev_desc->lba - 1)) { > - printf("%s: *** ERROR: Misplaced Backup GPT ***\n", > - __func__); > + log_debug("*** ERROR: Misplaced Backup GPT ***\n"); > return -1; > } > > if (is_gpt_valid(dev_desc, (dev_desc->lba - 1), > gpt_head, gpt_pte) !=3D 1) { > - printf("%s: *** ERROR: Invalid Backup GPT ***\n", > - __func__); > + log_debug("*** ERROR: Invalid Backup GPT ***\n"); > return -1; > } > > @@ -913,8 +909,8 @@ int write_mbr_and_gpt_partitions(struct blk_desc *de= v_desc, void *buf) > lba =3D 0; /* MBR is always at 0 */ > cnt =3D 1; /* MBR (1 block) */ > if (blk_dwrite(dev_desc, lba, cnt, buf) !=3D cnt) { > - printf("%s: failed writing '%s' (%d blks at 0x" LBAF ")\n", > - __func__, "MBR", cnt, lba); > + log_debug("failed writing '%s' (%d blks at 0x" LBAF ")\n", > + "MBR", cnt, lba); > return 1; > } > > @@ -922,16 +918,16 @@ int write_mbr_and_gpt_partitions(struct blk_desc *= dev_desc, void *buf) > lba =3D GPT_PRIMARY_PARTITION_TABLE_LBA; > cnt =3D 1; /* GPT Header (1 block) */ > if (blk_dwrite(dev_desc, lba, cnt, gpt_h) !=3D cnt) { > - printf("%s: failed writing '%s' (%d blks at 0x" LBAF ")\n", > - __func__, "Primary GPT Header", cnt, lba); > + log_debug("failed writing '%s' (%d blks at 0x" LBAF ")\n", > + "Primary GPT Header", cnt, lba); > return 1; > } > > lba =3D le64_to_cpu(gpt_h->partition_entry_lba); > cnt =3D gpt_e_blk_cnt; > if (blk_dwrite(dev_desc, lba, cnt, gpt_e) !=3D cnt) { > - printf("%s: failed writing '%s' (%d blks at 0x" LBAF ")\n", > - __func__, "Primary GPT Entries", cnt, lba); > + log_debug("failed writing '%s' (%d blks at 0x" LBAF ")\n", > + "Primary GPT Entries", cnt, lba); > return 1; > } > > @@ -941,16 +937,16 @@ int write_mbr_and_gpt_partitions(struct blk_desc *= dev_desc, void *buf) > lba =3D le64_to_cpu(gpt_h->partition_entry_lba); > cnt =3D gpt_e_blk_cnt; > if (blk_dwrite(dev_desc, lba, cnt, gpt_e) !=3D cnt) { > - printf("%s: failed writing '%s' (%d blks at 0x" LBAF ")\n", > - __func__, "Backup GPT Entries", cnt, lba); > + log_debug("failed writing '%s' (%d blks at 0x" LBAF ")\n", > + "Backup GPT Entries", cnt, lba); > return 1; > } > > lba =3D le64_to_cpu(gpt_h->my_lba); > cnt =3D 1; /* GPT Header (1 block) */ > if (blk_dwrite(dev_desc, lba, cnt, gpt_h) !=3D cnt) { > - printf("%s: failed writing '%s' (%d blks at 0x" LBAF ")\n", > - __func__, "Backup GPT Header", cnt, lba); > + log_debug("failed writing '%s' (%d blks at 0x" LBAF ")\n", > + "Backup GPT Header", cnt, lba); > return 1; > } > > @@ -1017,7 +1013,7 @@ static int is_gpt_valid(struct blk_desc *dev_desc,= u64 lba, > { > /* Confirm valid arguments prior to allocation. */ > if (!dev_desc || !pgpt_head) { > - printf("%s: Invalid Argument(s)\n", __func__); > + log_debug("Invalid Argument(s)\n"); > return 0; > } > > @@ -1025,19 +1021,19 @@ static int is_gpt_valid(struct blk_desc *dev_des= c, u64 lba, > > /* Read MBR Header from device */ > if (blk_dread(dev_desc, 0, 1, (ulong *)mbr) !=3D 1) { > - printf("*** ERROR: Can't read MBR header ***\n"); > + log_debug("*** ERROR: Can't read MBR header ***\n"); > return 0; > } > > /* Read GPT Header from device */ > if (blk_dread(dev_desc, (lbaint_t)lba, 1, pgpt_head) !=3D 1) { > - printf("*** ERROR: Can't read GPT header ***\n"); > + log_debug("*** ERROR: Can't read GPT header ***\n"); > return 0; > } > > /* Invalid but nothing to yell about. */ > if (le64_to_cpu(pgpt_head->signature) =3D=3D GPT_HEADER_CHROMEOS_IGNO= RE) { > - debug("ChromeOS 'IGNOREME' GPT header found and ignored\n"); > + log_debug("ChromeOS 'IGNOREME' GPT header found and ignored\n"); > return 2; > } > > @@ -1089,17 +1085,15 @@ static int find_valid_gpt(struct blk_desc *dev_d= esc, gpt_header *gpt_head, > > if (r !=3D 1) { > if (r !=3D 2) > - printf("%s: *** ERROR: Invalid GPT ***\n", __func__); > + log_debug("*** ERROR: Invalid GPT ***\n"); > > if (is_gpt_valid(dev_desc, (dev_desc->lba - 1), gpt_head, > pgpt_pte) !=3D 1) { > - printf("%s: *** ERROR: Invalid Backup GPT ***\n", > - __func__); > + log_debug("*** ERROR: Invalid Backup GPT ***\n"); > return 0; > } > if (r !=3D 2) > - printf("%s: *** Using Backup GPT ***\n", > - __func__); > + log_debug("*** Using Backup GPT ***\n"); > } > return 1; > } > @@ -1121,17 +1115,17 @@ static gpt_entry *alloc_read_gpt_entries(struct = blk_desc *dev_desc, > gpt_entry *pte =3D NULL; > > if (!dev_desc || !pgpt_head) { > - printf("%s: Invalid Argument(s)\n", __func__); > + log_debug("Invalid Argument(s)\n"); > return NULL; > } > > count =3D le32_to_cpu(pgpt_head->num_partition_entries) * > le32_to_cpu(pgpt_head->sizeof_partition_entry); > > - debug("%s: count =3D %u * %u =3D %lu\n", __func__, > - (u32) le32_to_cpu(pgpt_head->num_partition_entries), > - (u32) le32_to_cpu(pgpt_head->sizeof_partition_entry), > - (ulong)count); > + log_debug("count =3D %u * %u =3D %lu\n", > + (u32)le32_to_cpu(pgpt_head->num_partition_entries), > + (u32)le32_to_cpu(pgpt_head->sizeof_partition_entry), > + (ulong)count); > > /* Allocate memory for PTE, remember to FREE */ > if (count !=3D 0) { > @@ -1140,8 +1134,8 @@ static gpt_entry *alloc_read_gpt_entries(struct bl= k_desc *dev_desc, > } > > if (count =3D=3D 0 || pte =3D=3D NULL) { > - printf("%s: ERROR: Can't allocate %#lX bytes for GPT Entries\n", > - __func__, (ulong)count); > + log_debug("ERROR: Can't allocate %#lX bytes for GPT Entries\n", > + (ulong)count); > return NULL; > } > > @@ -1149,7 +1143,7 @@ static gpt_entry *alloc_read_gpt_entries(struct bl= k_desc *dev_desc, > blk =3D le64_to_cpu(pgpt_head->partition_entry_lba); > blk_cnt =3D BLOCK_CNT(count, dev_desc); > if (blk_dread(dev_desc, blk, (lbaint_t)blk_cnt, pte) !=3D blk_cnt) { > - printf("*** ERROR: Can't read GPT Entries ***\n"); > + log_debug("*** ERROR: Can't read GPT Entries ***\n"); > free(pte); > return NULL; > } > @@ -1167,7 +1161,7 @@ static int is_pte_valid(gpt_entry * pte) > efi_guid_t unused_guid; > > if (!pte) { > - printf("%s: Invalid Argument(s)\n", __func__); > + log_debug("Invalid Argument(s)\n"); > return 0; > } > > @@ -1179,8 +1173,8 @@ static int is_pte_valid(gpt_entry * pte) > if (memcmp(pte->partition_type_guid.b, unused_guid.b, > sizeof(unused_guid.b)) =3D=3D 0) { > > - debug("%s: Found an unused PTE GUID at 0x%08X\n", __func__, > - (unsigned int)(uintptr_t)pte); > + log_debug("Found an unused PTE GUID at 0x%08X\n", > + (unsigned int)(uintptr_t)pte); > > return 0; > } else {