Ignore:
Timestamp:
2011-05-25T21:16:58+02:00 (5 years ago)
Author:
florian
Message:

[kernel] fix mtd warnings

Fixes for the following warnings:

drivers/mtd/devices/block2mtd.c: In function '_open_bdev':
drivers/mtd/devices/block2mtd.c:272:3: warning: ISO C90 forbids mixed declarations and code
drivers/mtd/devices/block2mtd.c: In function 'add_device':
drivers/mtd/devices/block2mtd.c:399:13: warning: assignment discards qualifiers from pointer target type

In the case of 442-block2mtd_probe.patch, it's not until the insertion of a executable statement before the definition that causes a warning, so I've chosen to resolve the issue here by splitting the definition and the initialization into a definition and a statement (and assignment) instead.

Signed-off-by: Philip Prindeville <philipp@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/generic/patches-2.6.38/400-rootfs_split.patch

    r26905 r27007  
    112112+ 
    113113+       memcpy(dpart, part, sizeof(*part)); 
     114+       strcpy((char *)&dpart[1], ROOTFS_SPLIT_NAME); 
    114115+       dpart->name = (unsigned char *)&dpart[1]; 
    115 +       strcpy(dpart->name, ROOTFS_SPLIT_NAME); 
    116116+ 
    117117+       dpart->size = rpart->size - (split_offset - spart->offset); 
     
    303303+struct mtd_partition; 
    304304 struct mtd_partition { 
    305         char *name;                     /* identifier string */ 
     305-       char *name;                     /* identifier string */ 
     306+       const char *name;               /* identifier string */ 
    306307        uint64_t size;                  /* partition size */ 
    307308        uint64_t offset;                /* offset within the master MTD space */ 
Note: See TracChangeset for help on using the changeset viewer.