Changeset 27007


Ignore:
Timestamp:
2011-05-25T21:16:58+02:00 (7 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@…>

Location:
trunk/target/linux/generic
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/generic/patches-2.6.32/066-block2mtd_probe.patch

    r21952 r27007  
    11--- a/drivers/mtd/devices/block2mtd.c 
    22+++ b/drivers/mtd/devices/block2mtd.c 
    3 @@ -268,6 +268,7 @@ static int _open_bdev(struct block2mtd_d 
     3@@ -264,10 +264,12 @@ static int _open_bdev(struct block2mtd_d 
     4        bdev = open_bdev_exclusive(dev->devname, FMODE_READ|FMODE_WRITE, NULL); 
     5 #ifndef MODULE 
     6        if (IS_ERR(bdev)) { 
     7+               dev_t devt; 
     8  
    49                /* We might not have rootfs mounted at this point. Try 
    510                   to resolve the device name by other means. */ 
    611  
    712+               wait_for_device_probe(); 
    8                 dev_t devt = name_to_dev_t(dev->devname); 
     13-               dev_t devt = name_to_dev_t(dev->devname); 
     14+               devt = name_to_dev_t(dev->devname); 
    915                if (devt) { 
    1016                        bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ); 
  • trunk/target/linux/generic/patches-2.6.36/066-block2mtd_probe.patch

    r21952 r27007  
    11--- a/drivers/mtd/devices/block2mtd.c 
    22+++ b/drivers/mtd/devices/block2mtd.c 
    3 @@ -269,6 +269,7 @@ static int _open_bdev(struct block2mtd_d 
     3@@ -264,10 +264,12 @@ static int _open_bdev(struct block2mtd_d 
     4        bdev = open_bdev_exclusive(dev->devname, FMODE_READ|FMODE_WRITE, NULL); 
     5 #ifndef MODULE 
     6        if (IS_ERR(bdev)) { 
     7+               dev_t devt; 
     8  
    49                /* We might not have rootfs mounted at this point. Try 
    510                   to resolve the device name by other means. */ 
    611  
    712+               wait_for_device_probe(); 
    8                 dev_t devt = name_to_dev_t(dev->devname); 
     13-               dev_t devt = name_to_dev_t(dev->devname); 
     14+               devt = name_to_dev_t(dev->devname); 
    915                if (devt) { 
    1016                        bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ); 
  • trunk/target/linux/generic/patches-2.6.37/400-rootfs_split.patch

    r26955 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); 
     
    302302+struct mtd_partition; 
    303303 struct mtd_partition { 
    304         char *name;                     /* identifier string */ 
     304-       char *name;                     /* identifier string */ 
     305+       const char *name;               /* identifier string */ 
    305306        uint64_t size;                  /* partition size */ 
    306307        uint64_t offset;                /* offset within the master MTD space */ 
  • trunk/target/linux/generic/patches-2.6.37/442-block2mtd_probe.patch

    r26692 r27007  
    11--- a/drivers/mtd/devices/block2mtd.c 
    22+++ b/drivers/mtd/devices/block2mtd.c 
    3 @@ -268,6 +268,7 @@ static int _open_bdev(struct block2mtd_d 
     3@@ -264,10 +264,12 @@ static int _open_bdev(struct block2mtd_d 
     4        bdev = open_bdev_exclusive(dev->devname, FMODE_READ|FMODE_WRITE, NULL); 
     5 #ifndef MODULE 
     6        if (IS_ERR(bdev)) { 
     7+               dev_t devt; 
     8  
    49                /* We might not have rootfs mounted at this point. Try 
    510                   to resolve the device name by other means. */ 
    611  
    712+               wait_for_device_probe(); 
    8                 dev_t devt = name_to_dev_t(dev->devname); 
     13-               dev_t devt = name_to_dev_t(dev->devname); 
     14+               devt = name_to_dev_t(dev->devname); 
    915                if (devt) { 
    1016                        bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ); 
  • 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.