mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <uwe@kleine-koenig.org>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH master] partition: fix reference to wrong cdev in warning message
Date: Tue, 18 Mar 2025 12:16:10 +0100	[thread overview]
Message-ID: <p6sahp32nei5iesre27rbtdbsatui24ce53f3fx6sovbe2mis7@lkei2stdndjo> (raw)
In-Reply-To: <20250318082435.419053-1-a.fatoum@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 2068 bytes --]

On Tue, Mar 18, 2025 at 09:24:35AM +0100, Ahmad Fatoum wrote:
> For MBR and GPT, barebox creates links to the partitions, so they can be
> referenced both by index and partition label.
> 
> Failing to create a link is not an error, but results in a warning
> message. The current message claims that the link was pointing at the
> parent block device's cdev, but it actually was pointing at the child
> partition. Fix that.
> 
> Reported-by: Uwe Kleine-König <uwe@kleine-koenig.org>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  common/partitions.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/partitions.c b/common/partitions.c
> index 7562536cf9b8..bc90f51f6112 100644
> --- a/common/partitions.c
> +++ b/common/partitions.c
> @@ -63,7 +63,7 @@ static int register_one_partition(struct block_device *blk, struct partition *pa
>  	ret = devfs_create_link(cdev, partition_name);
>  	if (ret)
>  		dev_warn(blk->dev, "Failed to create link from %s to %s\n",
> -			 partition_name, blk->cdev.name);
> +			 partition_name, cdev->name);

This improves the error messages on my ts433 from

	WARNING: mmc0: Failed to create link from mmc0.primary to mmc0
	WARNING: mmc0: Failed to create link from mmc0.primary to mmc0
	WARNING: mmc0: Failed to create link from mmc0.primary to mmc0
	WARNING: mmc0: Failed to create link from mmc0.primary to mmc0
	WARNING: mmc0: Failed to create link from mmc0.primary to mmc0

to 

	WARNING: mmc0: Failed to create link from mmc0.primary to mmc0.2
	WARNING: mmc0: Failed to create link from mmc0.primary to mmc0.3
	WARNING: mmc0: Failed to create link from mmc0.primary to mmc0.4
	WARNING: mmc0: Failed to create link from mmc0.primary to mmc0.5
	WARNING: mmc0: Failed to create link from mmc0.primary to mmc0.6

I still don't understand why barebox intends to create mmc0.primary for
all these partitions, but still it's an obviously right improvement.

Acked-by: Uwe Kleine-König <uwe@kleine-koenig.org>

Best regards and thanks
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2025-03-18 11:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18  8:24 Ahmad Fatoum
2025-03-18 10:22 ` Sascha Hauer
2025-03-18 11:16 ` Uwe Kleine-König [this message]
2025-03-18 11:23   ` Ahmad Fatoum
2025-03-18 11:31     ` Uwe Kleine-König

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=p6sahp32nei5iesre27rbtdbsatui24ce53f3fx6sovbe2mis7@lkei2stdndjo \
    --to=uwe@kleine-koenig.org \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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