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

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

 



On Wed, Dec 16, 2009 at 02:08:36PM +0100, Uwe Kleine-König wrote:
> On Tue, Dec 15, 2009 at 09:40:10PM +0100, Marc Kleine-Budde wrote:
> > -----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.
> instead of sizeof("...") - 1, strlen should work.

Yes, it works, but adds to the binary space. This doesn't matter in this
case since the binary size does not really matter for the sandbox, but
we don't want other people to copy such things.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


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

  Powered by Linux