Fix warning in device_add_attrs
PATCH 1/1 Fix warning in device_add_attrs
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(-)
drivers/base/core.c +3 -3
@@ -259,10 +259,10 @@ static int device_add_attrs(struct devicif (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; }
Signature · 1 line
Jean Delvare