public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
To: Quentin Schulz <quentin.schulz@cherry.de>
Cc: u-boot@lists.denx.de,  Tom Rini <trini@konsulko.com>,
	 Patrick Delaunay <patrick.delaunay@foss.st.com>,
	 Marek Vasut <marex@denx.de>,
	 Emil Kronborg <emil.kronborg@protonmail.com>
Subject: Re: [PATCH 1/3] env: mmc: refactor mmc_offset_try_partition()
Date: Thu, 19 Sep 2024 08:53:29 +0200	[thread overview]
Message-ID: <8734lwm8wm.fsf@prevas.dk> (raw)
In-Reply-To: <376f36e2-1fa4-4fea-9af9-2c2e491cedbd@cherry.de> (Quentin Schulz's message of "Wed, 18 Sep 2024 18:59:39 +0200")

Quentin Schulz <quentin.schulz@cherry.de> writes:

>>   -	for (i = 1;;i++) {
>> -		ret = part_get_info(desc, i, &info);
>> -		if (ret < 0)
>> -			return ret;
>> -
>> -		if (str && !strncmp((const char *)info.name, str, sizeof(info.name)))
>> -			break;
>> -#ifdef CONFIG_PARTITION_TYPE_GUID
>> -		if (!str) {
>> -			const efi_guid_t env_guid = PARTITION_U_BOOT_ENVIRONMENT;
>> -			efi_guid_t type_guid;
>> -
>> -			uuid_str_to_bin(info.type_guid, type_guid.b, UUID_STR_FORMAT_GUID);
>> -			if (!memcmp(&env_guid, &type_guid, sizeof(efi_guid_t)))
>> -				break;
>> -		}
>> -#endif
>> +	if (str) {
>> +		ret = mmc_env_partition_by_name(desc, str, &info);
>> +	} else if (IS_ENABLED(CONFIG_PARTITION_TYPE_GUID) && !str) {
>
> nitpick: it's guaranteed that !str if reaching the else if based on
> the condition of the above if condition.

Ah, yes of course. This was just because I tried to translate the
existing

  #ifdef CONFIG_PARTITION_TYPE_GUID
    if (!str)

logic as closely as possible. I can resend. However, I plan to send some
followup cleanups and simplifications to env/mmc.c anyway later, but
didn't want to entangle those with this bugfix, so perhaps it can be
done as part of that.

Rasmus

  reply	other threads:[~2024-09-19  6:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-12 13:41 [PATCH 0/3] env: mmc: fix use of two separate partitions with proper type GUID Rasmus Villemoes
2024-09-12 13:41 ` [PATCH 1/3] env: mmc: refactor mmc_offset_try_partition() Rasmus Villemoes
2024-09-18 16:59   ` Quentin Schulz
2024-09-19  6:53     ` Rasmus Villemoes [this message]
2024-09-23 11:04       ` Quentin Schulz
2024-09-12 13:41 ` [PATCH 2/3] env: mmc: do not return an offset before the start of the partition Rasmus Villemoes
2024-09-12 13:41 ` [PATCH 3/3] env: mmc: rework mmc_env_partition_by_guid() to work with two separate partitions Rasmus Villemoes
2024-09-18 16:59   ` Quentin Schulz
2024-09-19  7:01     ` Rasmus Villemoes
2024-09-23 11:10       ` Quentin Schulz
2024-10-01 13:43 ` [PATCH 0/3] env: mmc: fix use of two separate partitions with proper type GUID Rasmus Villemoes
2024-10-01 14:43   ` Tom Rini
2024-10-01 17:37 ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734lwm8wm.fsf@prevas.dk \
    --to=rasmus.villemoes@prevas.dk \
    --cc=emil.kronborg@protonmail.com \
    --cc=marex@denx.de \
    --cc=patrick.delaunay@foss.st.com \
    --cc=quentin.schulz@cherry.de \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox