cramfs_common: coding style
Fix line lengths and white spaces. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
608d45015f
commit
fc2798c50b
|
@ -39,12 +39,13 @@ void super_toggle_endianness(int big_endian, struct cramfs_super *super)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void inode_toggle_endianness(int input_big_endian, int output_big_endian, struct cramfs_inode *inode_in, struct cramfs_inode *inode_out)
|
void inode_toggle_endianness(int input_big_endian, int output_big_endian,
|
||||||
|
struct cramfs_inode *inode_in,
|
||||||
|
struct cramfs_inode *inode_out)
|
||||||
{
|
{
|
||||||
if (input_big_endian == output_big_endian) {
|
if (input_big_endian == output_big_endian) {
|
||||||
memmove(inode_out, inode_in, sizeof(*inode_out));
|
memmove(inode_out, inode_in, sizeof(*inode_out));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
unsigned char inode_out_buf[sizeof(*inode_in)];
|
unsigned char inode_out_buf[sizeof(*inode_in)];
|
||||||
unsigned char *inode_in_buf = (unsigned char*)inode_in;
|
unsigned char *inode_in_buf = (unsigned char*)inode_in;
|
||||||
|
|
||||||
|
@ -60,9 +61,10 @@ void inode_toggle_endianness(int input_big_endian, int output_big_endian, struct
|
||||||
|
|
||||||
inode_out_buf[7] = inode_in_buf[7]; /* 8 bit: gid width */
|
inode_out_buf[7] = inode_in_buf[7]; /* 8 bit: gid width */
|
||||||
|
|
||||||
/* Stop the madness! Outlaw C bitfields! They are unportable and nasty!
|
/*
|
||||||
See for yourself what a mess this is: */
|
* Stop the madness! Outlaw C bitfields! They are unportable
|
||||||
|
* and nasty! See for yourself what a mess this is:
|
||||||
|
*/
|
||||||
if (output_big_endian) {
|
if (output_big_endian) {
|
||||||
inode_out_buf[ 8] = ( (inode_in_buf[ 8]&0x3F) << 2 ) |
|
inode_out_buf[ 8] = ( (inode_in_buf[ 8]&0x3F) << 2 ) |
|
||||||
( (inode_in_buf[11]&0xC0) >> 6 );
|
( (inode_in_buf[11]&0xC0) >> 6 );
|
||||||
|
@ -75,8 +77,7 @@ void inode_toggle_endianness(int input_big_endian, int output_big_endian, struct
|
||||||
|
|
||||||
inode_out_buf[11] = ( (inode_in_buf[ 9]&0x3F) << 2 ) |
|
inode_out_buf[11] = ( (inode_in_buf[ 9]&0x3F) << 2 ) |
|
||||||
( (inode_in_buf[ 8]&0xC0) >> 6 );
|
( (inode_in_buf[ 8]&0xC0) >> 6 );
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
inode_out_buf[ 8] = ( (inode_in_buf[ 8]&0xFD) >> 2 ) |
|
inode_out_buf[ 8] = ( (inode_in_buf[ 8]&0xFD) >> 2 ) |
|
||||||
( (inode_in_buf[11]&0x03) << 6 );
|
( (inode_in_buf[11]&0x03) << 6 );
|
||||||
|
|
||||||
|
@ -89,17 +90,20 @@ void inode_toggle_endianness(int input_big_endian, int output_big_endian, struct
|
||||||
inode_out_buf[11] = ( (inode_in_buf[ 9]&0xFD) >> 2 ) |
|
inode_out_buf[11] = ( (inode_in_buf[ 9]&0xFD) >> 2 ) |
|
||||||
( (inode_in_buf[ 8]&0x03) << 6 );
|
( (inode_in_buf[ 8]&0x03) << 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
memmove(inode_out, inode_out_buf, sizeof(*inode_out));
|
memmove(inode_out, inode_out_buf, sizeof(*inode_out));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void inode_to_host(int from_big_endian, struct cramfs_inode *inode_in, struct cramfs_inode *inode_out)
|
void inode_to_host(int from_big_endian, struct cramfs_inode *inode_in,
|
||||||
|
struct cramfs_inode *inode_out)
|
||||||
{
|
{
|
||||||
inode_toggle_endianness(from_big_endian, HOST_IS_BIG_ENDIAN, inode_in, inode_out);
|
inode_toggle_endianness(from_big_endian, HOST_IS_BIG_ENDIAN, inode_in,
|
||||||
|
inode_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
void inode_from_host(int to_big_endian, struct cramfs_inode *inode_in, struct cramfs_inode *inode_out)
|
void inode_from_host(int to_big_endian, struct cramfs_inode *inode_in,
|
||||||
|
struct cramfs_inode *inode_out)
|
||||||
{
|
{
|
||||||
inode_toggle_endianness(HOST_IS_BIG_ENDIAN, to_big_endian, inode_in, inode_out);
|
inode_toggle_endianness(HOST_IS_BIG_ENDIAN, to_big_endian, inode_in,
|
||||||
|
inode_out);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue