[PATCH] IB: Fix pack/unpack when size_bits == 64

Fix handling of fields with size_bits == 64. Pointed out by Hal Rosenstock.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Roland Dreier and committed by Linus Torvalds 48442962 dae4c1d2

+2 -2
+2 -2
drivers/infiniband/core/packer.c
··· 96 96 else 97 97 val = 0; 98 98 99 - mask = cpu_to_be64(((1ull << desc[i].size_bits) - 1) << shift); 99 + mask = cpu_to_be64((~0ull >> (64 - desc[i].size_bits)) << shift); 100 100 addr = (__be64 *) ((__be32 *) buf + desc[i].offset_words); 101 101 *addr = (*addr & ~mask) | (cpu_to_be64(val) & mask); 102 102 } else { ··· 176 176 __be64 *addr; 177 177 178 178 shift = 64 - desc[i].offset_bits - desc[i].size_bits; 179 - mask = ((1ull << desc[i].size_bits) - 1) << shift; 179 + mask = (~0ull >> (64 - desc[i].size_bits)) << shift; 180 180 addr = (__be64 *) buf + desc[i].offset_words; 181 181 val = (be64_to_cpup(addr) & mask) >> shift; 182 182 value_write(desc[i].struct_offset_bytes,