Commit:     54b2c8f93d7c3ddc04b55666b878fec437d32983
Parent:     393852ecfeec575ac78216b0eb58e4fd92f0816c
Author:     Jesper Juhl <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 13 23:53:08 2007 +0100
Committer:  Artem Bityutskiy <[EMAIL PROTECTED]>
CommitDate: Wed Dec 26 19:15:14 2007 +0200

    UBI: silence a warning
    This patch silences the following warning :
      drivers/mtd/ubi/vmt.c:73: warning: 'ret' may be used uninitialized in 
this function
    gcc can't see that we always initialize ret in all situations where it is
    actually used. The one case where it's not initialized is when we BUG(),
    but gcc doesn't know that we won't then continue and use an uninitialized
    This patch results in code that does exactely the same as before, but it
    also makes gcc shut up, so we generate one less line of warning noise.
    Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]>
    Signed-off-by: Artem Bityutskiy <[EMAIL PROTECTED]>
 drivers/mtd/ubi/vmt.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index 88629a3..e44948d 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -70,13 +70,14 @@ static struct device_attribute attr_vol_upd_marker =
 static ssize_t vol_attribute_show(struct device *dev,
                                  struct device_attribute *attr, char *buf)
-       int ret;
+       int ret = -ENODEV;
        struct ubi_volume *vol = container_of(dev, struct ubi_volume, dev);
        if (vol->removed) {
-               return -ENODEV;
+               return ret;
        if (attr == &attr_vol_reserved_ebs)
                ret = sprintf(buf, "%d\n", vol->reserved_pebs);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to