From fea30ad1bda2a2753e531237bc5b3efa1f4f4fa3 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 14 Nov 2022 11:19:06 +0000 Subject: [PATCH] ANDROID: preserve CRC for some DRM functions Commit 4523b6cac7bc ("linux/bits.h: make BIT(), GENMASK(), and friends available in assembly") caused the BIT_UUL() and BIT_MASK() macros to be redefined a bit to resolve some build problems when using those macros in assembly files. Unfortunatly changing these caused the CRC values of a bunch of DRM functions to change as a new set of () were used in the macros now. Fix this all up by going back to the old versions if we are building the CRCs, otherwise use the real versions of these macros. Bug: 161946584 Fixes: 4523b6cac7bc ("linux/bits.h: make BIT(), GENMASK(), and friends available in assembly") Change-Id: I15d7b91ec349fe557a8458d9f1a851bb07a8b116 Signed-off-by: Greg Kroah-Hartman --- include/linux/bits.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/bits.h b/include/linux/bits.h index 669d69441a62..6a6c603b7eac 100644 --- a/include/linux/bits.h +++ b/include/linux/bits.h @@ -3,11 +3,21 @@ #define __LINUX_BITS_H #include +#ifdef __GENKSYMS__ +#include +/* + * Old version of this macro to preserve the CRC signatures of some drm symbols. + * Crazy but true... + */ +#define BIT_ULL(nr) (1ULL << (nr)) +#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) +#else #include #define BIT(nr) (UL(1) << (nr)) #define BIT_ULL(nr) (ULL(1) << (nr)) #define BIT_MASK(nr) (UL(1) << ((nr) % BITS_PER_LONG)) +#endif #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) #define BIT_ULL_MASK(nr) (ULL(1) << ((nr) % BITS_PER_LONG_LONG)) #define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG)