diff options
| author | Michael Brown | 2016-05-02 14:20:26 +0200 |
|---|---|---|
| committer | Michael Brown | 2016-05-02 14:25:56 +0200 |
| commit | fe62f3c8312c3747c1a6c375b502cffa65d60f63 (patch) | |
| tree | d885048cd5ab9a7fef6d6f5dd693be086a098e68 /src | |
| parent | [librm] Reduce real-mode stack consumption in virt_call() (diff) | |
| download | ipxe-fe62f3c8312c3747c1a6c375b502cffa65d60f63.tar.gz ipxe-fe62f3c8312c3747c1a6c375b502cffa65d60f63.tar.xz ipxe-fe62f3c8312c3747c1a6c375b502cffa65d60f63.zip | |
[tg3] Fix _tg3_flag() for 64-bit builds
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>
Diffstat (limited to 'src')
| -rw-r--r-- | src/drivers/net/tg3/tg3.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/drivers/net/tg3/tg3.h b/src/drivers/net/tg3/tg3.h index d29523a83..0c3d23bb7 100644 --- a/src/drivers/net/tg3/tg3.h +++ b/src/drivers/net/tg3/tg3.h @@ -3324,7 +3324,7 @@ static inline int _tg3_flag(enum TG3_FLAGS flag, unsigned long *bits) { 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) |
