Skip to contentSkip to conversation

Silent compiler warning introduced by commit 801c135ce73d5df1caf3eca35b66a10824ae0707 (UBI: Unsorted Block Images)

PATCH Applied S.Çağlar Onur 3 participants 4 messages Feb 10, 2008 – Feb 12, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Silent compiler warning introduced by commit 801c135ce73d5df1caf3eca35b66a10824ae0707 (UBI: Unsorted Block Images)

Hi;

Following patch silents

drivers/mtd/ubi/vmt.c: In function `ubi_create_volume':
drivers/mtd/ubi/vmt.c:379: warning: statement with no effect

compiler warning introduced by commit 801c135ce73d5df1caf3eca35b66a10824ae0707 (UBI: Unsorted Block Images)

 drivers/mtd/ubi/vmt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/ubi/vmt.c +1 -1
index a3ca225..eafeaf0 100644
@@ -376,7 +376,7 @@ out_sysfs:
 	get_device(&vol->dev);
 	volume_sysfs_close(vol);
 out_gluebi:
-	ubi_destroy_gluebi(vol);
+	err = ubi_destroy_gluebi(vol);
 out_cdev:
 	cdev_del(&vol->cdev);
 out_mapping:

Cheers

Signature · 4 lines
S.Çağlar Onur <[email protected]>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
#1 lore raw
Quoted 19 lines · S.Çağlar Onur

Hi;

Following patch silents

drivers/mtd/ubi/vmt.c: In function `ubi_create_volume':
drivers/mtd/ubi/vmt.c:379: warning: statement with no effect

compiler warning introduced by commit 801c135ce73d5df1caf3eca35b66a10824ae0707 (UBI: Unsorted Block Images)

 drivers/mtd/ubi/vmt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/ubi/vmt.c +0 -0
index a3ca225..eafeaf0 100644

drivers/mtd/ubi/vmt.c out_sysfs: · line 382

Quoted 8 lines
drivers/mtd/ubi/vmt.c +1 -1
@@ -376,7 +376,7 @@ out_sysfs:
 	get_device(&vol->dev);
 	volume_sysfs_close(vol);
 out_gluebi:
-	ubi_destroy_gluebi(vol);
+	err = ubi_destroy_gluebi(vol);
 out_cdev:
 	cdev_del(&vol->cdev);
 out_mapping:

I think this is not correct. You change the err which caused the failure. You change it even to 0 if it doesn't fail and the whole function will seem like non-failing.

#2 lore raw

Hi;

10 Şub 2008 Paz tarihinde, Jiri Slaby şunları yazmıştı:

Quoted 3 lines

I think this is not correct. You change the err which caused the failure. You change it even to 0 if it doesn't fail and the whole function will seem like non-failing.

My bad, sorry for not looking carefully. Assuming a refactoring is not desired for just a compiler warning, is following acceptable (this kind of plain messages seems heavily used in vmt.c, so i'm again assuming its OK to use such style)?

commit 801c135ce73d5df1caf3eca35b66a10824ae0707 (UBI: Unsorted Block Images) introduced the warning

drivers/mtd/ubi/vmt.c: In function `ubi_create_volume':
drivers/mtd/ubi/vmt.c:379: warning: statement with no effect

 drivers/mtd/ubi/vmt.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/mtd/ubi/vmt.c +2 -1
index a3ca225..46410f6 100644
@@ -376,7 +376,8 @@ out_sysfs:
 	get_device(&vol->dev);
 	volume_sysfs_close(vol);
 out_gluebi:
-	ubi_destroy_gluebi(vol);
+	if(ubi_destroy_gluebi(vol))
+		ubi_err("cannot destroy device");
 out_cdev:
 	cdev_del(&vol->cdev);
 out_mapping:

Cheers

Signature · 4 lines
S.Çağlar Onur <[email protected]>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
#3 lore raw
Quoted 7 lines · S.Çağlar Onur

Hi;

10 Şub 2008 Paz tarihinde, Jiri Slaby şunları yazmıştı:

Quoted 1 line

I think this is not correct. You change the err which caused the failure. You change it even to 0 if it doesn't fail and the whole function will seem like non-failing.

My bad, sorry for not looking carefully. Assuming a refactoring is not desired for just a compiler warning, is following acceptable (this kind of plain messages seems heavily used in vmt.c, so i'm again assuming its OK to use such style)?

Quoted 9 lines

commit 801c135ce73d5df1caf3eca35b66a10824ae0707 (UBI: Unsorted Block Images) introduced the warning

drivers/mtd/ubi/vmt.c: In function `ubi_create_volume':
drivers/mtd/ubi/vmt.c:379: warning: statement with no effect

 drivers/mtd/ubi/vmt.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Thanks, applied to UBI git with Minor changes, will send git-pull request shortly.

Please, note that my e-mail address is not [email protected], see MAINTAINERS.

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)