* Understanding OOB data read implementation (II)
@ 2010-10-15 11:29 David Peverley
2010-10-16 19:37 ` Artem Bityutskiy
0 siblings, 1 reply; 2+ messages in thread
From: David Peverley @ 2010-10-15 11:29 UTC (permalink / raw)
To: linux-mtd
Hi again...!
I've also noticed after blindly copying it that in the DoC drivers
that the OOB reads use the ops->len for size :
static int doc_read_oob(struct mtd_info *mtd, loff_t ofs,
struct mtd_oob_ops *ops)
...
uint8_t *buf = ops->oobbuf;
size_t len = ops->len;
...
Reading mtd.h and the following patch summary :
http://www.mail-archive.com/git-commits-head@vger.kernel.org/msg03799.html
I suspect this is wrong and should be using ops->ooblen instead. This
is especially true given that mtdchar.c leaves ops->len
uninitialised....! (should mtdchar.c:mtd_do_readoob() not zero the ops
structure as it's a local automatic so not zero-initialised?) Again
this is copied in doc2001.c and doc2001plus.c.
Cheers,
~Pev
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Understanding OOB data read implementation (II)
2010-10-15 11:29 Understanding OOB data read implementation (II) David Peverley
@ 2010-10-16 19:37 ` Artem Bityutskiy
0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2010-10-16 19:37 UTC (permalink / raw)
To: David Peverley; +Cc: linux-mtd
On Fri, 2010-10-15 at 12:29 +0100, David Peverley wrote:
> Hi again...!
>
> I've also noticed after blindly copying it that in the DoC drivers
> that the OOB reads use the ops->len for size :
> static int doc_read_oob(struct mtd_info *mtd, loff_t ofs,
> struct mtd_oob_ops *ops)
> ...
> uint8_t *buf = ops->oobbuf;
> size_t len = ops->len;
> ...
>
> Reading mtd.h and the following patch summary :
> http://www.mail-archive.com/git-commits-head@vger.kernel.org/msg03799.html
>
> I suspect this is wrong and should be using ops->ooblen instead. This
> is especially true given that mtdchar.c leaves ops->len
> uninitialised....! (should mtdchar.c:mtd_do_readoob() not zero the ops
> structure as it's a local automatic so not zero-initialised?) Again
> this is copied in doc2001.c and doc2001plus.c.
If you can test the change - please send a patch.
--
Best Regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-16 19:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-15 11:29 Understanding OOB data read implementation (II) David Peverley
2010-10-16 19:37 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox