]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Aug 2024 16:10:46 +0000 (18:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Aug 2024 16:10:46 +0000 (18:10 +0200)
added patches:
tools-move-alignment-related-macros-to-new-linux-align.h.patch

queue-5.10/series
queue-5.10/tools-move-alignment-related-macros-to-new-linux-align.h.patch [new file with mode: 0644]

index c148e858f5f99397dcfe56fec3c3d5696320b9b9..e66b1da3bec463b05eacdb43a717979ea668173a 100644 (file)
@@ -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 (file)
index 0000000..dc62a96
--- /dev/null
@@ -0,0 +1,59 @@
+From 10a04ff09bcc39e0044190ffe9f00f998f13647c Mon Sep 17 00:00:00 2001
+From: Alexander Lobakin <aleksander.lobakin@intel.com>
+Date: Wed, 27 Mar 2024 16:23:48 +0100
+Subject: tools: move alignment-related macros to new <linux/align.h>
+
+From: Alexander Lobakin <aleksander.lobakin@intel.com>
+
+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
+<linux/align.h> inside the tools/ folder and include it where needed.
+
+Signed-off-by: Yury Norov <yury.norov@gmail.com>
+Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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 <uapi/linux/const.h>
++
++#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 <string.h>
++#include <linux/align.h>
+ #include <linux/bitops.h>
+ #include <stdlib.h>
+ #include <linux/kernel.h>
+@@ -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)