diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1858-drm-amd-Avoid-using-x86-specific-_BITOPS_LONG_SHIFT.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1858-drm-amd-Avoid-using-x86-specific-_BITOPS_LONG_SHIFT.patch | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1858-drm-amd-Avoid-using-x86-specific-_BITOPS_LONG_SHIFT.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1858-drm-amd-Avoid-using-x86-specific-_BITOPS_LONG_SHIFT.patch new file mode 100644 index 00000000..e000ed16 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1858-drm-amd-Avoid-using-x86-specific-_BITOPS_LONG_SHIFT.patch @@ -0,0 +1,77 @@ +From e35bd48969f381d1f1de92f402669c5b95698cba Mon Sep 17 00:00:00 2001 +From: Felix Kuehling <Felix.Kuehling@amd.com> +Date: Tue, 19 Sep 2017 16:11:30 -0400 +Subject: [PATCH 1858/4131] drm/amd: Avoid using x86-specific + _BITOPS_LONG_SHIFT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> +Acked-by: Christian König <christian.koenig@amd.com> +--- + drivers/gpu/drm/amd/include/linux/chash.h | 22 +++++++++++++++------- + 1 file changed, 15 insertions(+), 7 deletions(-) + +diff --git a/drivers/gpu/drm/amd/include/linux/chash.h b/drivers/gpu/drm/amd/include/linux/chash.h +index c89b92b..6dc1599 100644 +--- a/drivers/gpu/drm/amd/include/linux/chash.h ++++ b/drivers/gpu/drm/amd/include/linux/chash.h +@@ -27,7 +27,15 @@ + #include <linux/types.h> + #include <linux/hash.h> + #include <linux/bug.h> +-#include <linux/bitops.h> ++#include <asm/bitsperlong.h> ++ ++#if BITS_PER_LONG == 32 ++# define _CHASH_LONG_SHIFT 5 ++#elif BITS_PER_LONG == 64 ++# define _CHASH_LONG_SHIFT 6 ++#else ++# error "Unexpected BITS_PER_LONG" ++#endif + + struct __chash_table { + u8 bits; +@@ -283,31 +291,31 @@ struct chash_iter { + static inline bool chash_iter_is_valid(const struct chash_iter iter) + { + BUG_ON((unsigned)iter.slot >= (1 << iter.table->bits)); +- return !!(iter.table->valid_bitmap[iter.slot >> _BITOPS_LONG_SHIFT] & ++ return !!(iter.table->valid_bitmap[iter.slot >> _CHASH_LONG_SHIFT] & + iter.mask); + } + static inline bool chash_iter_is_empty(const struct chash_iter iter) + { + BUG_ON((unsigned)iter.slot >= (1 << iter.table->bits)); +- return !(iter.table->occup_bitmap[iter.slot >> _BITOPS_LONG_SHIFT] & ++ return !(iter.table->occup_bitmap[iter.slot >> _CHASH_LONG_SHIFT] & + iter.mask); + } + + static inline void chash_iter_set_valid(const struct chash_iter iter) + { + BUG_ON((unsigned)iter.slot >= (1 << iter.table->bits)); +- iter.table->valid_bitmap[iter.slot >> _BITOPS_LONG_SHIFT] |= iter.mask; +- iter.table->occup_bitmap[iter.slot >> _BITOPS_LONG_SHIFT] |= iter.mask; ++ iter.table->valid_bitmap[iter.slot >> _CHASH_LONG_SHIFT] |= iter.mask; ++ iter.table->occup_bitmap[iter.slot >> _CHASH_LONG_SHIFT] |= iter.mask; + } + static inline void chash_iter_set_invalid(const struct chash_iter iter) + { + BUG_ON((unsigned)iter.slot >= (1 << iter.table->bits)); +- iter.table->valid_bitmap[iter.slot >> _BITOPS_LONG_SHIFT] &= ~iter.mask; ++ iter.table->valid_bitmap[iter.slot >> _CHASH_LONG_SHIFT] &= ~iter.mask; + } + static inline void chash_iter_set_empty(const struct chash_iter iter) + { + BUG_ON((unsigned)iter.slot >= (1 << iter.table->bits)); +- iter.table->occup_bitmap[iter.slot >> _BITOPS_LONG_SHIFT] &= ~iter.mask; ++ iter.table->occup_bitmap[iter.slot >> _CHASH_LONG_SHIFT] &= ~iter.mask; + } + + static inline u32 chash_iter_key32(const struct chash_iter iter) +-- +2.7.4 + |