Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR. No conflicts, or adjacent changes. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -87,4 +87,15 @@ static inline __u32 rol32(__u32 word, unsigned int shift)
|
||||
return (word << shift) | (word >> ((-shift) & 31));
|
||||
}
|
||||
|
||||
/**
|
||||
* sign_extend64 - sign extend a 64-bit value using specified bit as sign-bit
|
||||
* @value: value to sign extend
|
||||
* @index: 0 based bit index (0<=index<64) to sign bit
|
||||
*/
|
||||
static __always_inline __s64 sign_extend64(__u64 value, int index)
|
||||
{
|
||||
__u8 shift = 63 - index;
|
||||
return (__s64)(value << shift) >> shift;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user