net/mlx4_core: Fix endianness bug in set_param_l
authorJack Morgenstein <jackm@dev.mellanox.co.il>
Thu, 7 Mar 2013 03:46:54 +0000 (03:46 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Mar 2013 20:52:03 +0000 (15:52 -0500)
commite7dbeba85600aa2c8daf99f8f53d9ad27e88b810
treef1e7a199ef86154b0ae262c13c1b661cf86f97e8
parent0081c8f3814a8344ca975c085d987ec6c90499ae
net/mlx4_core: Fix endianness bug in set_param_l

The set_param_l function assumes casting a u64 pointer to a u32 pointer
allows to access the lower 32bits, but it results in writing the upper
32 bits on big endian systems.

The fixed function reads the upper 32 bits of the 64 argument, and or's
them with the 32 bits of the 32-bit value passed to the function.

Since this is now a "read-modify-write" operation, we got many
"unintialized variable" warnings which needed to be fixed as well.

Reported-by: Alexander Schmidt <alexschm@de.ibm.com>.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/cq.c
drivers/net/ethernet/mellanox/mlx4/main.c
drivers/net/ethernet/mellanox/mlx4/mlx4.h
drivers/net/ethernet/mellanox/mlx4/mr.c
drivers/net/ethernet/mellanox/mlx4/pd.c
drivers/net/ethernet/mellanox/mlx4/port.c
drivers/net/ethernet/mellanox/mlx4/qp.c
drivers/net/ethernet/mellanox/mlx4/srq.c