lkml.org 
[lkml]   [2008]   [Feb]   [16]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
/
DateFri, 15 Feb 2008 21:28:15 -0800
FromAndrew Morton <>
SubjectRe: [PATCH] ufs: [bl]e*_add_cpu conversion
On Wed, 13 Feb 2008 10:41:44 +0100 Roel Kluin <12o3l@tiscali.nl> wrote:

> you may also want these:
> ---
> [bl]e_add_cpu conversion in return
> 
> Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
> ---
> diff --git a/fs/ufs/swab.h b/fs/ufs/swab.h
> index 1683d2b..a1e3000 100644
> --- a/fs/ufs/swab.h
> +++ b/fs/ufs/swab.h
> @@ -44,18 +44,22 @@ static __inline u32
>  fs64_add(struct super_block *sbp, u32 *n, int d)
>  {
>  	if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
> -		return *n = cpu_to_le64(le64_to_cpu(*n)+d);
> +		le64_add_cpu(n, d);
>  	else
> -		return *n = cpu_to_be64(be64_to_cpu(*n)+d);
> +		be64_add_cpu(n, d);
> +
> +	return *n;
>  }
> 
>  static __inline u32
>  fs64_sub(struct super_block *sbp, u32 *n, int d)
>  {
>  	if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE)
> -		return *n = cpu_to_le64(le64_to_cpu(*n)-d);
> +		le64_add_cpu(n, -d);
>  	else
> -		return *n = cpu_to_be64(be64_to_cpu(*n)-d);
> +		be64_add_cpu(n, -d);
> +
> +	return *n;
>  }
> 
>  static __inline u32

upsets powerpc (at least):

fs/ufs/swab.h: In function `fs64_add':
fs/ufs/swab.h:47: warning: passing arg 1 of `le64_add_cpu' from incompatible pointer type
fs/ufs/swab.h:49: warning: passing arg 1 of `be64_add_cpu' from incompatible pointer type
fs/ufs/swab.h: In function `fs64_sub':
fs/ufs/swab.h:58: warning: passing arg 1 of `le64_add_cpu' from incompatible pointer type
fs/ufs/swab.h:60: warning: passing arg 1 of `be64_add_cpu' from incompatible pointer type
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2008-02-16 05:31    [from the cache]
©2003-2008