From: Greg Kroah-Hartman Date: Tue, 28 May 2019 16:01:44 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v5.1.6~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e79f8d26f55f4d68af8042304202cbe0b322df7d;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: perf-tools-no-need-to-include-bitops.h-in-util.h.patch tools-include-adopt-linux-bits.h.patch --- diff --git a/queue-4.4/perf-tools-no-need-to-include-bitops.h-in-util.h.patch b/queue-4.4/perf-tools-no-need-to-include-bitops.h-in-util.h.patch new file mode 100644 index 00000000000..dc1a041f0d0 --- /dev/null +++ b/queue-4.4/perf-tools-no-need-to-include-bitops.h-in-util.h.patch @@ -0,0 +1,48 @@ +From 61a3c2244aa4378b19eb9516454352e79af909ef Mon Sep 17 00:00:00 2001 +From: Arnaldo Carvalho de Melo +Date: Tue, 18 Apr 2017 11:42:23 -0300 +Subject: perf tools: No need to include bitops.h in util.h + +From: Arnaldo Carvalho de Melo + +commit 6dcca6df4b73d409628c7b4464c63d4eb9d4d13a upstream. + +When we switched to the kernel's roundup_pow_of_two we forgot to remove +this include from util.h, do it now. + +Cc: Adrian Hunter +Cc: David Ahern +Cc: Jiri Olsa +Cc: Namhyung Kim +Cc: Wang Nan +Fixes: 91529834d1de ("perf evlist: Use roundup_pow_of_two") +Link: http://lkml.kernel.org/n/tip-kfye5rxivib6155cltx0bw4h@git.kernel.org +Signed-off-by: Arnaldo Carvalho de Melo +[bwh: Backported to 4.4 as dependency of "tools include: Adopt linux/bits.h": + - Include in util/string.c to avoid build regression + - Adjust context] +Signed-off-by: Ben Hutchings +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/util/string.c | 1 + + tools/perf/util/util.h | 1 - + 2 files changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/perf/util/string.c ++++ b/tools/perf/util/string.c +@@ -1,4 +1,5 @@ + #include "util.h" ++#include + #include "linux/string.h" + + #define K 1024LL +--- a/tools/perf/util/util.h ++++ b/tools/perf/util/util.h +@@ -76,7 +76,6 @@ + #include + #include + #include +-#include + #include + + extern const char *graph_line; diff --git a/queue-4.4/series b/queue-4.4/series index b2c1a529f8a..0482250222d 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -88,3 +88,5 @@ media-cpia2-fix-use-after-free-in-cpia2_exit.patch media-vivid-use-vfree-instead-of-kfree-for-dev-bitmap_cap.patch ssb-fix-possible-null-pointer-dereference-in-ssb_host_pcmcia_exit.patch at76c50x-usb-don-t-register-led_trigger-if-usb_register_driver-failed.patch +perf-tools-no-need-to-include-bitops.h-in-util.h.patch +tools-include-adopt-linux-bits.h.patch diff --git a/queue-4.4/tools-include-adopt-linux-bits.h.patch b/queue-4.4/tools-include-adopt-linux-bits.h.patch new file mode 100644 index 00000000000..1629f429e00 --- /dev/null +++ b/queue-4.4/tools-include-adopt-linux-bits.h.patch @@ -0,0 +1,89 @@ +From 8f5e9ea4ea676344ee84908bbead31776dd86cde Mon Sep 17 00:00:00 2001 +From: Arnaldo Carvalho de Melo +Date: Tue, 25 Sep 2018 10:55:59 -0300 +Subject: tools include: Adopt linux/bits.h + +From: Arnaldo Carvalho de Melo + +commit ba4aa02b417f08a0bee5e7b8ed70cac788a7c854 upstream. + +So that we reduce the difference of tools/include/linux/bitops.h to the +original kernel file, include/linux/bitops.h, trying to remove the need +to define BITS_PER_LONG, to avoid clashes with asm/bitsperlong.h. + +And the things removed from tools/include/linux/bitops.h are really in +linux/bits.h, so that we can have a copy and then +tools/perf/check_headers.sh will tell us when new stuff gets added to +linux/bits.h so that we can check if it is useful and if any adjustment +needs to be done to the tools/{include,arch}/ copies. + +Cc: Adrian Hunter +Cc: Alexander Sverdlin +Cc: David Ahern +Cc: Jiri Olsa +Cc: Namhyung Kim +Cc: Wang Nan +Link: https://lkml.kernel.org/n/tip-y1sqyydvfzo0bjjoj4zsl562@git.kernel.org +Signed-off-by: Arnaldo Carvalho de Melo +[bwh: Backported to 4.4 as dependency of "x86/msr-index: Cleanup bit defines": + - Drop change in check-headers.sh + - Adjust context] +Signed-off-by: Ben Hutchings +Signed-off-by: Greg Kroah-Hartman +--- + tools/include/linux/bitops.h | 7 ++----- + tools/include/linux/bits.h | 26 ++++++++++++++++++++++++++ + 2 files changed, 28 insertions(+), 5 deletions(-) + create mode 100644 tools/include/linux/bits.h + +--- a/tools/include/linux/bitops.h ++++ b/tools/include/linux/bitops.h +@@ -3,17 +3,14 @@ + + #include + #include +-#include +- + #ifndef __WORDSIZE + #define __WORDSIZE (__SIZEOF_LONG__ * 8) + #endif + + #define BITS_PER_LONG __WORDSIZE ++#include ++#include + +-#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) +-#define BIT_WORD(nr) ((nr) / BITS_PER_LONG) +-#define BITS_PER_BYTE 8 + #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) + #define BITS_TO_U64(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u64)) + #define BITS_TO_U32(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u32)) +--- /dev/null ++++ b/tools/include/linux/bits.h +@@ -0,0 +1,26 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++#ifndef __LINUX_BITS_H ++#define __LINUX_BITS_H ++#include ++ ++#define BIT(nr) (1UL << (nr)) ++#define BIT_ULL(nr) (1ULL << (nr)) ++#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) ++#define BIT_WORD(nr) ((nr) / BITS_PER_LONG) ++#define BIT_ULL_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG)) ++#define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG) ++#define BITS_PER_BYTE 8 ++ ++/* ++ * Create a contiguous bitmask starting at bit position @l and ending at ++ * position @h. For example ++ * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000. ++ */ ++#define GENMASK(h, l) \ ++ (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) ++ ++#define GENMASK_ULL(h, l) \ ++ (((~0ULL) - (1ULL << (l)) + 1) & \ ++ (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h)))) ++ ++#endif /* __LINUX_BITS_H */