[PATCH] cramfs: probe(): fix cdev lookup

Marc Kleine-Budde mkl at pengutronix.de
Tue Dec 15 15:28:07 EST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Peter Korsgaard wrote:
> Strip /dev/ part of backing store before passing cdev_by_name, as
> cramfs_probe() will otherwise always fail.
> 
> Signed-off-by: Peter Korsgaard <jacmet at sunsite.dk>
> ---
>  fs/cramfs/cramfs.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c
> index d49ac32..73a3759 100644
> --- a/fs/cramfs/cramfs.c
> +++ b/fs/cramfs/cramfs.c
> @@ -431,7 +431,7 @@ static int cramfs_probe(struct device_d *dev)
>  	if (strncmp(fsdev->backingstore, "/dev/", 5))
>  		return -ENODEV;
>  
> -	priv->cdev = cdev_by_name(fsdev->backingstore);
> +	priv->cdev = cdev_by_name(fsdev->backingstore + 5);

IMHO sizeof("/dev/") (and perhaps a comment) make the code more readable.

>  	if (!priv->cdev)
>  		return -ENODEV;
>  

cheers, Marc

- --
Pengutronix e.K.                         | Marc Kleine-Budde           |
Linux Solutions for Science and Industry | Phone: +49-231-2826-924     |
Vertretung West/Dortmund                 | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686         | http://www.pengutronix.de   |
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksn8VcACgkQjTAFq1RaXHMm/QCfddTzLuq7oe/K7wupwwfShCo2
ZBYAoJLx2bHj7Z+a2i8DwRhdGNnDCidf
=GsLz
-----END PGP SIGNATURE-----




More information about the u-boot-v2 mailing list