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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Peter Korsgaard wrote:
>>>>>> "Marc" == Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> writes:
> 
> Hi,
> 
>  >> @@ -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);
> 
>  Marc> IMHO sizeof("/dev/") (and perhaps a comment) make the code more readable.
> 
> That would be sizeof("/dev/") - 1 to not count in the trailing 0.  The

doh! I'm out of brown paper bags.

> same should presumably also be done in the strncmp above - I don't find
> the sizeof - 1 syntax particular more readable, but I can change it if
> preferred.

mkl
- --
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

iEYEARECAAYFAksn9CoACgkQjTAFq1RaXHOfqQCfam0hzM7PNw8+/udW/h4zPmCL
EI4AnRZq9aZiac1KT9NWohrU3QaUrzBC
=AH16
-----END PGP SIGNATURE-----

_______________________________________________
u-boot-v2 mailing list
u-boot-v2@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/u-boot-v2

[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux