* [PATCH] UDF: Fix compiler warning
@ 2011-02-22 19:04 George G. Davis
2011-02-23 9:35 ` Jan Kara
0 siblings, 1 reply; 2+ messages in thread
From: George G. Davis @ 2011-02-22 19:04 UTC (permalink / raw)
To: Jan Kara, linux-kernel; +Cc: Russell King
From: Dirk Behme <dirk.behme@de.bosch.com>
Fix compiler warning
fs/udf/balloc.c: In function 'udf_bitmap_new_block':
fs/udf/balloc.c:273: warning: passing argument 1 of '_find_next_bit_le' from incompatible pointer type
fs/udf/balloc.c:285: warning: passing argument 1 of '_find_next_bit_le' from incompatible pointer type
fs/udf/balloc.c:311: warning: passing argument 1 of '_find_next_bit_le' from incompatible pointer type
fs/udf/balloc.c:325: warning: passing argument 1 of '_find_next_bit_le' from incompatible pointer type
The main fix is to add a cast in ext2_find_next_bit().
As all other usage locations of udf_find_next_one_bit()
directly use bh->b_data (which is a char *), the useless
(char *) cast in line 311 can be removed, too.
Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: George G. Davis <gdavis@mvista.com>
---
This fixes a long standing ARM Linux kernel UDF_FS build warning [1].
[1] http://armlinux.simtec.co.uk/kautobuild/2.6.37/warnings.html#modules
fs/udf/balloc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
index 306ee39..8994dd0 100644
--- a/fs/udf/balloc.c
+++ b/fs/udf/balloc.c
@@ -31,7 +31,7 @@
#define udf_set_bit(nr, addr) ext2_set_bit(nr, addr)
#define udf_test_bit(nr, addr) ext2_test_bit(nr, addr)
#define udf_find_next_one_bit(addr, size, offset) \
- ext2_find_next_bit(addr, size, offset)
+ ext2_find_next_bit((unsigned long *)(addr), size, offset)
static int read_block_bitmap(struct super_block *sb,
struct udf_bitmap *bitmap, unsigned int block,
@@ -297,7 +297,7 @@ repeat:
break;
}
} else {
- bit = udf_find_next_one_bit((char *)bh->b_data,
+ bit = udf_find_next_one_bit(bh->b_data,
sb->s_blocksize << 3,
group_start << 3);
if (bit < sb->s_blocksize << 3)
--
1.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] UDF: Fix compiler warning
2011-02-22 19:04 [PATCH] UDF: Fix compiler warning George G. Davis
@ 2011-02-23 9:35 ` Jan Kara
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2011-02-23 9:35 UTC (permalink / raw)
To: George G. Davis; +Cc: Jan Kara, linux-kernel, Russell King
On Tue 22-02-11 14:04:19, George G. Davis wrote:
> From: Dirk Behme <dirk.behme@de.bosch.com>
>
> Fix compiler warning
>
> fs/udf/balloc.c: In function 'udf_bitmap_new_block':
> fs/udf/balloc.c:273: warning: passing argument 1 of '_find_next_bit_le' from incompatible pointer type
> fs/udf/balloc.c:285: warning: passing argument 1 of '_find_next_bit_le' from incompatible pointer type
> fs/udf/balloc.c:311: warning: passing argument 1 of '_find_next_bit_le' from incompatible pointer type
> fs/udf/balloc.c:325: warning: passing argument 1 of '_find_next_bit_le' from incompatible pointer type
>
> The main fix is to add a cast in ext2_find_next_bit().
>
> As all other usage locations of udf_find_next_one_bit()
> directly use bh->b_data (which is a char *), the useless
> (char *) cast in line 311 can be removed, too.
>
> Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
> Signed-off-by: George G. Davis <gdavis@mvista.com>
Thanks. Merged into my tree.
Honza
> ---
> This fixes a long standing ARM Linux kernel UDF_FS build warning [1].
>
> [1] http://armlinux.simtec.co.uk/kautobuild/2.6.37/warnings.html#modules
>
> fs/udf/balloc.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
> index 306ee39..8994dd0 100644
> --- a/fs/udf/balloc.c
> +++ b/fs/udf/balloc.c
> @@ -31,7 +31,7 @@
> #define udf_set_bit(nr, addr) ext2_set_bit(nr, addr)
> #define udf_test_bit(nr, addr) ext2_test_bit(nr, addr)
> #define udf_find_next_one_bit(addr, size, offset) \
> - ext2_find_next_bit(addr, size, offset)
> + ext2_find_next_bit((unsigned long *)(addr), size, offset)
>
> static int read_block_bitmap(struct super_block *sb,
> struct udf_bitmap *bitmap, unsigned int block,
> @@ -297,7 +297,7 @@ repeat:
> break;
> }
> } else {
> - bit = udf_find_next_one_bit((char *)bh->b_data,
> + bit = udf_find_next_one_bit(bh->b_data,
> sb->s_blocksize << 3,
> group_start << 3);
> if (bit < sb->s_blocksize << 3)
> --
> 1.7.4
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-23 9:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-22 19:04 [PATCH] UDF: Fix compiler warning George G. Davis
2011-02-23 9:35 ` Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox