From: Greg Kroah-Hartman Date: Thu, 29 Aug 2024 16:10:46 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.19.321~86 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=70b4c3f452fc1c78e940e362d4d81fe520dd650f;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: tools-move-alignment-related-macros-to-new-linux-align.h.patch --- diff --git a/queue-5.10/series b/queue-5.10/series index c148e858f5f..e66b1da3bec 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -119,3 +119,4 @@ alsa-timer-relax-start-tick-time-check-for-slave-timer-elements.patch nfsd-don-t-call-freezable_schedule_timeout-after-each-successful-page-allocation-in-svc_alloc_arg.patch bluetooth-hci_ldisc-check-hci_uart_proto_ready-flag-in-hciuartgetproto.patch input-mt-limit-max-slots.patch +tools-move-alignment-related-macros-to-new-linux-align.h.patch diff --git a/queue-5.10/tools-move-alignment-related-macros-to-new-linux-align.h.patch b/queue-5.10/tools-move-alignment-related-macros-to-new-linux-align.h.patch new file mode 100644 index 00000000000..dc62a96381b --- /dev/null +++ b/queue-5.10/tools-move-alignment-related-macros-to-new-linux-align.h.patch @@ -0,0 +1,59 @@ +From 10a04ff09bcc39e0044190ffe9f00f998f13647c Mon Sep 17 00:00:00 2001 +From: Alexander Lobakin +Date: Wed, 27 Mar 2024 16:23:48 +0100 +Subject: tools: move alignment-related macros to new + +From: Alexander Lobakin + +commit 10a04ff09bcc39e0044190ffe9f00f998f13647c upstream. + +Currently, tools have *ALIGN*() macros scattered across the unrelated +headers, as there are only 3 of them and they were added separately +each time on an as-needed basis. +Anyway, let's make it more consistent with the kernel headers and allow +using those macros outside of the mentioned headers. Create + inside the tools/ folder and include it where needed. + +Signed-off-by: Yury Norov +Signed-off-by: Alexander Lobakin +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + tools/include/linux/align.h | 12 ++++++++++++ + tools/include/linux/bitmap.h | 2 +- + 2 files changed, 13 insertions(+), 1 deletion(-) + create mode 100644 tools/include/linux/align.h + +--- /dev/null ++++ b/tools/include/linux/align.h +@@ -0,0 +1,12 @@ ++/* SPDX-License-Identifier: GPL-2.0-only */ ++ ++#ifndef _TOOLS_LINUX_ALIGN_H ++#define _TOOLS_LINUX_ALIGN_H ++ ++#include ++ ++#define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) ++#define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a)) ++#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) ++ ++#endif /* _TOOLS_LINUX_ALIGN_H */ +--- a/tools/include/linux/bitmap.h ++++ b/tools/include/linux/bitmap.h +@@ -3,6 +3,7 @@ + #define _PERF_BITOPS_H + + #include ++#include + #include + #include + #include +@@ -166,7 +167,6 @@ static inline int bitmap_and(unsigned lo + #define BITMAP_MEM_ALIGNMENT (8 * sizeof(unsigned long)) + #endif + #define BITMAP_MEM_MASK (BITMAP_MEM_ALIGNMENT - 1) +-#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) + + static inline int bitmap_equal(const unsigned long *src1, + const unsigned long *src2, unsigned int nbits)