Commit
86f96a4 ("[tg3] Remove x86-specific inline assembly")
introduced a regression in _tg3_flag() in 64-bit builds, since any
flags in the upper 32 bits of a 64-bit unsigned long would be
discarded when truncating to a 32-bit int.
Debugged-by: Shane Thompson <shane.thompson@aeontech.com.au>
Tested-by: Shane Thompson <shane.thompson@aeontech.com.au>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
{
unsigned int index = ( flag / ( 8 * sizeof ( *bits ) ) );
unsigned int bit = ( flag % ( 8 * sizeof ( *bits ) ) );
- return ( bits[index] & ( 1UL << bit ) );
+ return ( !! ( bits[index] & ( 1UL << bit ) ) );
}
static inline void _tg3_flag_set(enum TG3_FLAGS flag, unsigned long *bits)