Fix the following warning which I see with gcc 3.2:
drivers/base/core.c: In function `device_add_attrs':
drivers/base/core.c:251: warning: `i' might be used uninitialized in this 
function
It's a false positive, but it can be worked around easily, and the new
code makes rather more sense.

Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 drivers/base/core.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.20.orig/drivers/base/core.c       2007-02-06 09:25:49.000000000 
+0100
+++ linux-2.6.20/drivers/base/core.c    2007-02-06 20:40:46.000000000 +0100
@@ -259,10 +259,10 @@ static int device_add_attrs(struct devic
                        if (error)
                                break;
                }
+               if (error)
+                       while (--i >= 0)
+                               device_remove_file(dev, &class->dev_attrs[i]);
        }
-       if (error)
-               while (--i >= 0)
-                       device_remove_file(dev, &class->dev_attrs[i]);
        return error;
 }
 


-- 
Jean Delvare
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to