[PATCH 03/12] mtd: support reading OOB without ECC

Artem Bityutskiy dedekind1 at gmail.com
Sun Sep 11 08:12:44 EDT 2011


On Sun, 2011-09-11 at 14:46 +0300, Artem Bityutskiy wrote:
> On Tue, 2011-08-30 at 18:45 -0700, Brian Norris wrote:
> > -static int mtd_do_readoob(struct mtd_info *mtd, uint64_t start,
> > -	uint32_t length, void __user *ptr, uint32_t __user *retp)
> > +static int mtd_do_readoob(struct file *file, struct mtd_info *mtd,
> > +	uint64_t start, uint32_t length, void __user *ptr,
> > +	uint32_t __user *retp)
> >  {
> > +	struct mtd_file_info *mfi = file->private_data;
> >  	struct mtd_oob_ops ops;
> >  	int ret = 0;
> 
> Why do you pass struct file pointer to this function instead of just
> passing the MTD_MODE constant directly? What if the caller does not have
> any 'struct file' at all (e.g., at some point someone would want to make
> an JFFS2 or YAFFS2 optimization and use this function). Do I miss
> something?
> 
> If there is not strong reason for passing 'file', could we pass 'int
> mode' instead?

Although after looking a bit closer, I think it is fine, sorry. Pushed
to l2-mtd-2.6.git, thanks!

-- 
Best Regards,
Artem Bityutskiy




More information about the linux-mtd mailing list