LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Silent compiler warning introduced by commit 801c135ce73d5df1caf3eca35b66a10824ae0707 (UBI: Unsorted Block Images)
@ 2008-02-10  3:37 S.Çağlar Onur
  2008-02-10  8:39 ` Jiri Slaby
  0 siblings, 1 reply; 4+ messages in thread
From: S.Çağlar Onur @ 2008-02-10  3:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: dedekind, haver, torvalds

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)

Signed-off-by: S.Çağlar Onur <caglar@pardus.org.tr>

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

diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index a3ca225..eafeaf0 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -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
-- 
S.Çağlar Onur <caglar@pardus.org.tr>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Silent compiler warning introduced by commit 801c135ce73d5df1caf3eca35b66a10824ae0707 (UBI: Unsorted Block Images)
  2008-02-10  3:37 [PATCH] Silent compiler warning introduced by commit 801c135ce73d5df1caf3eca35b66a10824ae0707 (UBI: Unsorted Block Images) S.Çağlar Onur
@ 2008-02-10  8:39 ` Jiri Slaby
  2008-02-10 23:44   ` S.Çağlar Onur
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Slaby @ 2008-02-10  8:39 UTC (permalink / raw)
  To: caglar; +Cc: linux-kernel, dedekind, haver, torvalds

On 02/10/2008 04:37 AM, S.Çağlar Onur wrote:
> 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)
> 
> Signed-off-by: S.Çağlar Onur <caglar@pardus.org.tr>
> 
>  drivers/mtd/ubi/vmt.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
> index a3ca225..eafeaf0 100644
> --- a/drivers/mtd/ubi/vmt.c
> +++ b/drivers/mtd/ubi/vmt.c
> @@ -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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Silent compiler warning introduced by commit 801c135ce73d5df1caf3eca35b66a10824ae0707 (UBI: Unsorted Block Images)
  2008-02-10  8:39 ` Jiri Slaby
@ 2008-02-10 23:44   ` S.Çağlar Onur
  2008-02-12  9:33     ` Artem Bityutskiy
  0 siblings, 1 reply; 4+ messages in thread
From: S.Çağlar Onur @ 2008-02-10 23:44 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: linux-kernel, dedekind, haver, torvalds

Hi;

10 Şub 2008 Paz tarihinde, Jiri Slaby şunları yazmıştı: 
> 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(-)

diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index a3ca225..46410f6 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -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
-- 
S.Çağlar Onur <caglar@pardus.org.tr>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Silent compiler warning introduced by commit 801c135ce73d5df1caf3eca35b66a10824ae0707 (UBI: Unsorted Block Images)
  2008-02-10 23:44   ` S.Çağlar Onur
@ 2008-02-12  9:33     ` Artem Bityutskiy
  0 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2008-02-12  9:33 UTC (permalink / raw)
  To: caglar; +Cc: Jiri Slaby, linux-kernel, torvalds

S.Çağlar Onur wrote:
> Hi;
> 
> 10 Şub 2008 Paz tarihinde, Jiri Slaby şunları yazmıştı: 
>> 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(-)
> 

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

Please, note that my e-mail address is not dedekind@linutronix.de,
see MAINTAINERS.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-02-12  9:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-10  3:37 [PATCH] Silent compiler warning introduced by commit 801c135ce73d5df1caf3eca35b66a10824ae0707 (UBI: Unsorted Block Images) S.Çağlar Onur
2008-02-10  8:39 ` Jiri Slaby
2008-02-10 23:44   ` S.Çağlar Onur
2008-02-12  9:33     ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).