The cpu_to_be32()
family (where the "32" can
be replaced by 64 or 16, and the "be" can be replaced by "le") are
the general way to do endian conversions in the kernel: they
return the converted value. All variations supply the reverse as
well: be32_to_cpu()
, etc.
There are two major variations of these functions: the pointer
variation, such as cpu_to_be32p()
, which take
a pointer to the given type, and return the converted value. The
other variation is the "in-situ" family, such as
cpu_to_be32s()
, which convert value referred
to by the pointer, and return void.