mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] udf: fix sparse warnings
@ 2008-11-27 22:12 Hannes Eder
  2008-12-01 12:09 ` Jan Kara
  0 siblings, 1 reply; 4+ messages in thread
From: Hannes Eder @ 2008-11-27 22:12 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-kernel, kernel-janitors, trivial

Fix this sparse warnings:

  fs/udf/balloc.c:843:3: warning: returning void-valued expression
  fs/udf/balloc.c:847:3: warning: returning void-valued expression
  fs/udf/balloc.c:851:3: warning: returning void-valued expression
  fs/udf/balloc.c:855:3: warning: returning void-valued expression

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
---
 fs/udf/balloc.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
index c0e87db..7328291 100644
--- a/fs/udf/balloc.c
+++ b/fs/udf/balloc.c
@@ -840,21 +840,21 @@ void udf_free_blocks(struct super_block *sb, struct inode *inode,
 	struct udf_part_map *map = &UDF_SB(sb)->s_partmaps[partition];
 
 	if (map->s_partition_flags & UDF_PART_FLAG_UNALLOC_BITMAP) {
-		return udf_bitmap_free_blocks(sb, inode,
-					      map->s_uspace.s_bitmap,
-					      bloc, offset, count);
+		udf_bitmap_free_blocks(sb, inode, map->s_uspace.s_bitmap,
+				       bloc, offset, count);
+		return;
 	} else if (map->s_partition_flags & UDF_PART_FLAG_UNALLOC_TABLE) {
-		return udf_table_free_blocks(sb, inode,
-					     map->s_uspace.s_table,
-					     bloc, offset, count);
+		udf_table_free_blocks(sb, inode, map->s_uspace.s_table,
+				      bloc, offset, count);
+		return;
 	} else if (map->s_partition_flags & UDF_PART_FLAG_FREED_BITMAP) {
-		return udf_bitmap_free_blocks(sb, inode,
-					      map->s_fspace.s_bitmap,
-					      bloc, offset, count);
+		udf_bitmap_free_blocks(sb, inode, map->s_fspace.s_bitmap,
+				       bloc, offset, count);
+		return;
 	} else if (map->s_partition_flags & UDF_PART_FLAG_FREED_TABLE) {
-		return udf_table_free_blocks(sb, inode,
-					     map->s_fspace.s_table,
-					     bloc, offset, count);
+		udf_table_free_blocks(sb, inode, map->s_fspace.s_table,
+				      bloc, offset, count);
+		return;
 	} else {
 		return;
 	}
-- 
1.5.6.3


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

* Re: [PATCH] udf: fix sparse warnings
  2008-11-27 22:12 [PATCH] udf: fix sparse warnings Hannes Eder
@ 2008-12-01 12:09 ` Jan Kara
  2008-12-01 14:55   ` Hannes Eder
  2008-12-01 21:04   ` Bob Copeland
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Kara @ 2008-12-01 12:09 UTC (permalink / raw)
  To: Hannes Eder; +Cc: linux-kernel, kernel-janitors, trivial

On Thu 27-11-08 23:12:55, Hannes Eder wrote:
> Fix this sparse warnings:
> 
>   fs/udf/balloc.c:843:3: warning: returning void-valued expression
>   fs/udf/balloc.c:847:3: warning: returning void-valued expression
>   fs/udf/balloc.c:851:3: warning: returning void-valued expression
>   fs/udf/balloc.c:855:3: warning: returning void-valued expression
> 
> Signed-off-by: Hannes Eder <hannes@hanneseder.net>
  Thanks for the patch. But when we are at it, I'd rather go for the
following change:

>From f3facf9a4a60bba9f1fa0c779fc441c6aff90eb4 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Mon, 1 Dec 2008 13:06:10 +0100
Subject: [PATCH] udf: fix sparse warnings:

Fix sparse warnings:

  fs/udf/balloc.c:843:3: warning: returning void-valued expression
  fs/udf/balloc.c:847:3: warning: returning void-valued expression
  fs/udf/balloc.c:851:3: warning: returning void-valued expression
  fs/udf/balloc.c:855:3: warning: returning void-valued expression

Reported-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/udf/balloc.c |   23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
index c0e87db..cde1a0d 100644
--- a/fs/udf/balloc.c
+++ b/fs/udf/balloc.c
@@ -840,24 +840,19 @@ void udf_free_blocks(struct super_block *sb, struct inode *inode,
 	struct udf_part_map *map = &UDF_SB(sb)->s_partmaps[partition];
 
 	if (map->s_partition_flags & UDF_PART_FLAG_UNALLOC_BITMAP) {
-		return udf_bitmap_free_blocks(sb, inode,
-					      map->s_uspace.s_bitmap,
-					      bloc, offset, count);
+		udf_bitmap_free_blocks(sb, inode, map->s_uspace.s_bitmap,
+				       bloc, offset, count);
 	} else if (map->s_partition_flags & UDF_PART_FLAG_UNALLOC_TABLE) {
-		return udf_table_free_blocks(sb, inode,
-					     map->s_uspace.s_table,
-					     bloc, offset, count);
+		udf_table_free_blocks(sb, inode, map->s_uspace.s_table,
+				      bloc, offset, count);
 	} else if (map->s_partition_flags & UDF_PART_FLAG_FREED_BITMAP) {
-		return udf_bitmap_free_blocks(sb, inode,
-					      map->s_fspace.s_bitmap,
-					      bloc, offset, count);
+		udf_bitmap_free_blocks(sb, inode, map->s_fspace.s_bitmap,
+				       bloc, offset, count);
 	} else if (map->s_partition_flags & UDF_PART_FLAG_FREED_TABLE) {
-		return udf_table_free_blocks(sb, inode,
-					     map->s_fspace.s_table,
-					     bloc, offset, count);
-	} else {
-		return;
+		udf_table_free_blocks(sb, inode, map->s_fspace.s_table,
+				      bloc, offset, count);
 	}
+	return;
 }
 
 inline int udf_prealloc_blocks(struct super_block *sb,
-- 
1.6.0.4



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

* Re: [PATCH] udf: fix sparse warnings
  2008-12-01 12:09 ` Jan Kara
@ 2008-12-01 14:55   ` Hannes Eder
  2008-12-01 21:04   ` Bob Copeland
  1 sibling, 0 replies; 4+ messages in thread
From: Hannes Eder @ 2008-12-01 14:55 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-kernel, kernel-janitors, trivial

On Mon, Dec 1, 2008 at 1:09 PM, Jan Kara <jack@suse.cz> wrote:
> On Thu 27-11-08 23:12:55, Hannes Eder wrote:
>> Fix this sparse warnings:
>>
>>   fs/udf/balloc.c:843:3: warning: returning void-valued expression
>>   fs/udf/balloc.c:847:3: warning: returning void-valued expression
>>   fs/udf/balloc.c:851:3: warning: returning void-valued expression
>>   fs/udf/balloc.c:855:3: warning: returning void-valued expression
>>
>> Signed-off-by: Hannes Eder <hannes@hanneseder.net>
>  Thanks for the patch. But when we are at it, I'd rather go for the
> following change:
>
> From f3facf9a4a60bba9f1fa0c779fc441c6aff90eb4 Mon Sep 17 00:00:00 2001
> From: Jan Kara <jack@suse.cz>
> Date: Mon, 1 Dec 2008 13:06:10 +0100
> Subject: [PATCH] udf: fix sparse warnings:
>
> Fix sparse warnings:
>
>  fs/udf/balloc.c:843:3: warning: returning void-valued expression
>  fs/udf/balloc.c:847:3: warning: returning void-valued expression
>  fs/udf/balloc.c:851:3: warning: returning void-valued expression
>  fs/udf/balloc.c:855:3: warning: returning void-valued expression
>
> Reported-by: Hannes Eder <hannes@hanneseder.net>
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
>  fs/udf/balloc.c |   23 +++++++++--------------
>  1 files changed, 9 insertions(+), 14 deletions(-)
>
> diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
> index c0e87db..cde1a0d 100644
> --- a/fs/udf/balloc.c
> +++ b/fs/udf/balloc.c
> @@ -840,24 +840,19 @@ void udf_free_blocks(struct super_block *sb, struct inode *inode,
>        struct udf_part_map *map = &UDF_SB(sb)->s_partmaps[partition];
>
>        if (map->s_partition_flags & UDF_PART_FLAG_UNALLOC_BITMAP) {
> -               return udf_bitmap_free_blocks(sb, inode,
> -                                             map->s_uspace.s_bitmap,
> -                                             bloc, offset, count);
> +               udf_bitmap_free_blocks(sb, inode, map->s_uspace.s_bitmap,
> +                                      bloc, offset, count);
>        } else if (map->s_partition_flags & UDF_PART_FLAG_UNALLOC_TABLE) {
> -               return udf_table_free_blocks(sb, inode,
> -                                            map->s_uspace.s_table,
> -                                            bloc, offset, count);
> +               udf_table_free_blocks(sb, inode, map->s_uspace.s_table,
> +                                     bloc, offset, count);
>        } else if (map->s_partition_flags & UDF_PART_FLAG_FREED_BITMAP) {
> -               return udf_bitmap_free_blocks(sb, inode,
> -                                             map->s_fspace.s_bitmap,
> -                                             bloc, offset, count);
> +               udf_bitmap_free_blocks(sb, inode, map->s_fspace.s_bitmap,
> +                                      bloc, offset, count);
>        } else if (map->s_partition_flags & UDF_PART_FLAG_FREED_TABLE) {
> -               return udf_table_free_blocks(sb, inode,
> -                                            map->s_fspace.s_table,
> -                                            bloc, offset, count);
> -       } else {
> -               return;
> +               udf_table_free_blocks(sb, inode, map->s_fspace.s_table,
> +                                     bloc, offset, count);
>        }
> +       return;
>  }
>
>  inline int udf_prealloc_blocks(struct super_block *sb,
> --
> 1.6.0.4

I prefer your version.  I though about it as well, but then tried to
do kind of  'minimal change' patch, and leave the control flow as is.

Hannes

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

* Re: [PATCH] udf: fix sparse warnings
  2008-12-01 12:09 ` Jan Kara
  2008-12-01 14:55   ` Hannes Eder
@ 2008-12-01 21:04   ` Bob Copeland
  1 sibling, 0 replies; 4+ messages in thread
From: Bob Copeland @ 2008-12-01 21:04 UTC (permalink / raw)
  To: Jan Kara; +Cc: Hannes Eder, linux-kernel, kernel-janitors, trivial

On Mon, Dec 1, 2008 at 7:09 AM, Jan Kara <jack@suse.cz> wrote:
> From f3facf9a4a60bba9f1fa0c779fc441c6aff90eb4 Mon Sep 17 00:00:00 2001
> From: Jan Kara <jack@suse.cz>
> Date: Mon, 1 Dec 2008 13:06:10 +0100
> Subject: [PATCH] udf: fix sparse warnings:
[...]
> -       } else {
> -               return;
> +               udf_table_free_blocks(sb, inode, map->s_fspace.s_table,
> +                                     bloc, offset, count);
>        }
> +       return;
>  }

Harmless, but in this case you don't need the return at all.

-- 
Bob Copeland %% www.bobcopeland.com

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

end of thread, other threads:[~2008-12-01 21:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-27 22:12 [PATCH] udf: fix sparse warnings Hannes Eder
2008-12-01 12:09 ` Jan Kara
2008-12-01 14:55   ` Hannes Eder
2008-12-01 21:04   ` Bob Copeland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®