LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/1 linux-next] udf: use int for allocated blocks instead of sector_t
@ 2015-03-15  9:54 Fabian Frederick
  2015-03-16  7:24 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2015-03-15  9:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jan Kara, Fabian Frederick

Fix the following warnings:

fs/udf/balloc.c:768:15: warning: conversion to 'sector_t' from 'int'
may change the sign of the result [-Wsign-conversion]
   allocated = udf_bitmap_prealloc_blocks(sb,
               ^
fs/udf/balloc.c:773:15: warning: conversion to 'sector_t' from 'int'
may change the sign of the result [-Wsign-conversion]
   allocated = udf_table_prealloc_blocks(sb,
               ^
fs/udf/balloc.c:778:15: warning: conversion to 'sector_t' from 'int'
may change the sign of the result [-Wsign-conversion]
   allocated = udf_bitmap_prealloc_blocks(sb,
               ^
fs/udf/balloc.c:783:15: warning: conversion to 'sector_t' from 'int'
may change the sign of the result [-Wsign-conversion]
   allocated = udf_table_prealloc_blocks(sb,
               ^
fs/udf/balloc.c:791:26: warning: conversion to 'loff_t' from 'sector_t'
may change the sign of the result [-Wsign-conversion]
   inode_add_bytes(inode, allocated << sb->s_blocksize_bits);
                          ^
fs/udf/balloc.c:792:2: warning: conversion to 'int' from 'sector_t'
may alter its value [-Wconversion]
  return allocated;

Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/udf/balloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
index 1ba2baa..75d5f421 100644
--- a/fs/udf/balloc.c
+++ b/fs/udf/balloc.c
@@ -762,7 +762,7 @@ inline int udf_prealloc_blocks(struct super_block *sb,
 			       uint32_t block_count)
 {
 	struct udf_part_map *map = &UDF_SB(sb)->s_partmaps[partition];
-	sector_t allocated;
+	int allocated;
 
 	if (map->s_partition_flags & UDF_PART_FLAG_UNALLOC_BITMAP)
 		allocated = udf_bitmap_prealloc_blocks(sb,
-- 
1.9.1


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

* Re: [PATCH 1/1 linux-next] udf: use int for allocated blocks instead of sector_t
  2015-03-15  9:54 [PATCH 1/1 linux-next] udf: use int for allocated blocks instead of sector_t Fabian Frederick
@ 2015-03-16  7:24 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2015-03-16  7:24 UTC (permalink / raw)
  To: Fabian Frederick; +Cc: linux-kernel, Jan Kara

On Sun 15-03-15 10:54:23, Fabian Frederick wrote:
> Fix the following warnings:
> 
> fs/udf/balloc.c:768:15: warning: conversion to 'sector_t' from 'int'
> may change the sign of the result [-Wsign-conversion]
>    allocated = udf_bitmap_prealloc_blocks(sb,
>                ^
> fs/udf/balloc.c:773:15: warning: conversion to 'sector_t' from 'int'
> may change the sign of the result [-Wsign-conversion]
>    allocated = udf_table_prealloc_blocks(sb,
>                ^
> fs/udf/balloc.c:778:15: warning: conversion to 'sector_t' from 'int'
> may change the sign of the result [-Wsign-conversion]
>    allocated = udf_bitmap_prealloc_blocks(sb,
>                ^
> fs/udf/balloc.c:783:15: warning: conversion to 'sector_t' from 'int'
> may change the sign of the result [-Wsign-conversion]
>    allocated = udf_table_prealloc_blocks(sb,
>                ^
> fs/udf/balloc.c:791:26: warning: conversion to 'loff_t' from 'sector_t'
> may change the sign of the result [-Wsign-conversion]
>    inode_add_bytes(inode, allocated << sb->s_blocksize_bits);
>                           ^
> fs/udf/balloc.c:792:2: warning: conversion to 'int' from 'sector_t'
> may alter its value [-Wconversion]
>   return allocated;
> 
> Suggested-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
  Thanks. Applied to my tree.

								Honza

> ---
>  fs/udf/balloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
> index 1ba2baa..75d5f421 100644
> --- a/fs/udf/balloc.c
> +++ b/fs/udf/balloc.c
> @@ -762,7 +762,7 @@ inline int udf_prealloc_blocks(struct super_block *sb,
>  			       uint32_t block_count)
>  {
>  	struct udf_part_map *map = &UDF_SB(sb)->s_partmaps[partition];
> -	sector_t allocated;
> +	int allocated;
>  
>  	if (map->s_partition_flags & UDF_PART_FLAG_UNALLOC_BITMAP)
>  		allocated = udf_bitmap_prealloc_blocks(sb,
> -- 
> 1.9.1
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

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

end of thread, other threads:[~2015-03-16  7:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-15  9:54 [PATCH 1/1 linux-next] udf: use int for allocated blocks instead of sector_t Fabian Frederick
2015-03-16  7:24 ` Jan Kara

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).