lkml.org 
[lkml]   [1999]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: le32_to_cpu() help...
Date
Followup to:  <19991102114522.E525@mff.cuni.cz>
By author: Jakub Jelinek <jakub@redhat.com>
In newsgroup: linux.dev.kernel
> >
> > Then when do we use le32_to_cpu( ) , and when do we use cpu_to_le32( )?
>
> The names tell it. le32_to_cpu is used for convesions from 32bit little
> endian data into CPUs endianness, cpu_to_le32 is used for convesions from
> CPU endianness to little endian 32bit data.
> Actually, both macros do the same thing, but one should make the differences
> clear to make code more readable so that anyone can quickly find out whether
> some data is kept in native endianness or some particular one.
>

Both macros do the same thing on all *currently supported*
architectures. One never know when a funny thing from Mars shows up;
perhaps a 48-bit architecture, who knows...

-hpa
--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.069 / U:0.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site