mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Marco Felsch <m.felsch@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH] block: follow links before check if cdev_is_block_partition
Date: Thu, 24 Jul 2025 13:28:12 +0200	[thread overview]
Message-ID: <7b363e3a-978e-4632-9c46-604960e875a3@pengutronix.de> (raw)
In-Reply-To: <20250723155545.682170-1-m.felsch@pengutronix.de>

On 7/23/25 17:55, Marco Felsch wrote:
> cdev_is_block_partition() fails if a cdev is passed which is a
> parition-link. Most of our barebox code is link-aware by resolving the
> links first.
> 
> Make it more user-friendly and resolve the possible cdev parttion link
> first before performing the actual check.
> 
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>

Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

> ---
>  include/block.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/block.h b/include/block.h
> index 5ce3eb7d7838..a5a2dcf58995 100644
> --- a/include/block.h
> +++ b/include/block.h
> @@ -107,6 +107,7 @@ static inline bool cdev_is_block_device(const struct cdev *cdev)
>  
>  static inline bool cdev_is_block_partition(const struct cdev *cdev)
>  {
> +	cdev = cdev_readlink(cdev);
>  	return cdev_is_block_device(cdev) && cdev_is_partition(cdev);
>  }
>  

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




      reply	other threads:[~2025-07-24 13:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-23 15:55 Marco Felsch
2025-07-24 11:28 ` Ahmad Fatoum [this message]

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=7b363e3a-978e-4632-9c46-604960e875a3@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=m.felsch@pengutronix.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