Re: [Yaffs] PATCH!!! PATCH!!! (Was Sorry state of YAFFS2)

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Sergey Kubushyn
Date:  
To: Charles Manning
CC: yaffs-list
Subject: Re: [Yaffs] PATCH!!! PATCH!!! (Was Sorry state of YAFFS2)
On Fri, 14 Oct 2005, Sergey Kubushyn wrote:

Sorry, a typo...

> +void nandmtd2_buf2pt(yaffs_Device *dev, yaffs_PackedTags2 *pt, int
> is_raw)
> +{
> +    struct mtd_info *mtd = (struct mtd_info *)(dev->genericDevice);
> +    int    i, j = 0, k, n;
> +    __u8    pt2_byte_buf[PT2_BYTES];
> +
> +
> +    if (!is_raw) {
> +        pt->t.sequenceNumber = *((unsigned int *)
> &dev->spareBuffer[0]);
> +        pt->t.objectId = *((unsigned int *)
> &dev->spareBuffer[4]);
> +        pt->t.chunkId = *((unsigned int *)
> &dev->spareBuffer[8]);
> +        pt->t.byteCount = *((unsigned int *)
> &dev->spareBuffer[12]);
> +        pt->ecc.colParity = dev->spareBuffer[16];
> +        pt->ecc.lineParity = (dev->spareBuffer[17] &
> 0x000000ff) |
> +             ((dev->spareBuffer[18] << 8) & 0x0000ff00) |
> +             ((dev->spareBuffer[19] << 16) & 0x00ff0000) |
> +             ((dev->spareBuffer[20] >> 24) & 0xff000000);

                                               ^^ must be "<<"


> +        pt->ecc.lineParityPrime = (dev->spareBuffer[21] &
> 0x000000ff) |
> +             ((dev->spareBuffer[22] << 8) & 0x0000ff00) |
> +             ((dev->spareBuffer[23] << 16) & 0x00ff0000) |
> +             ((dev->spareBuffer[24] >> 24) & 0xff000000);

                                               ^^ ditto

> +    } else {
> +        k = mtd->oobinfo.oobfree[j][0];
> +        n = mtd->oobinfo.oobfree[j][1];


---
******************************************************************
*  KSI@home    KOI8 Net  < >  The impossible we do immediately.  *
*  Las Vegas   NV, USA   < >  Miracles require 24-hour notice.   *
******************************************************************