From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Sasha Levin <sashal@kernel.org>,
linux-fsdevel@vger.kernel.org
Subject: [PATCH AUTOSEL 5.15 13/24] tools: Fix math.h breakage
Date: Mon, 6 Dec 2021 16:12:18 -0500 [thread overview]
Message-ID: <20211206211230.1660072-13-sashal@kernel.org> (raw)
In-Reply-To: <20211206211230.1660072-1-sashal@kernel.org>
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
[ Upstream commit d6e6a27d960f9f07aef0b979c49c6736ede28f75 ]
Commit 98e1385ef24b ("include/linux/radix-tree.h: replace kernel.h with
the necessary inclusions") broke the radix tree test suite in two
different ways; first by including math.h which didn't exist in the
tools directory, and second by removing an implicit include of
spinlock.h before lockdep.h. Fix both issues.
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/include/linux/kernel.h | 22 +--------------------
tools/include/linux/math.h | 25 ++++++++++++++++++++++++
tools/testing/radix-tree/linux/lockdep.h | 3 +++
3 files changed, 29 insertions(+), 21 deletions(-)
create mode 100644 tools/include/linux/math.h
diff --git a/tools/include/linux/kernel.h b/tools/include/linux/kernel.h
index a7e54a08fb54c..3e8df500cfbd4 100644
--- a/tools/include/linux/kernel.h
+++ b/tools/include/linux/kernel.h
@@ -7,6 +7,7 @@
#include <assert.h>
#include <linux/build_bug.h>
#include <linux/compiler.h>
+#include <linux/math.h>
#include <endian.h>
#include <byteswap.h>
@@ -14,8 +15,6 @@
#define UINT_MAX (~0U)
#endif
-#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
-
#define PERF_ALIGN(x, a) __PERF_ALIGN_MASK(x, (typeof(x))(a)-1)
#define __PERF_ALIGN_MASK(x, mask) (((x)+(mask))&~(mask))
@@ -52,15 +51,6 @@
_min1 < _min2 ? _min1 : _min2; })
#endif
-#ifndef roundup
-#define roundup(x, y) ( \
-{ \
- const typeof(y) __y = y; \
- (((x) + (__y - 1)) / __y) * __y; \
-} \
-)
-#endif
-
#ifndef BUG_ON
#ifdef NDEBUG
#define BUG_ON(cond) do { if (cond) {} } while (0)
@@ -104,16 +94,6 @@ int scnprintf_pad(char * buf, size_t size, const char * fmt, ...);
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
-/*
- * This looks more complex than it should be. But we need to
- * get the type for the ~ right in round_down (it needs to be
- * as wide as the result!), and we want to evaluate the macro
- * arguments just once each.
- */
-#define __round_mask(x, y) ((__typeof__(x))((y)-1))
-#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
-#define round_down(x, y) ((x) & ~__round_mask(x, y))
-
#define current_gfp_context(k) 0
#define synchronize_rcu()
diff --git a/tools/include/linux/math.h b/tools/include/linux/math.h
new file mode 100644
index 0000000000000..4e7af99ec9eb4
--- /dev/null
+++ b/tools/include/linux/math.h
@@ -0,0 +1,25 @@
+#ifndef _TOOLS_MATH_H
+#define _TOOLS_MATH_H
+
+/*
+ * This looks more complex than it should be. But we need to
+ * get the type for the ~ right in round_down (it needs to be
+ * as wide as the result!), and we want to evaluate the macro
+ * arguments just once each.
+ */
+#define __round_mask(x, y) ((__typeof__(x))((y)-1))
+#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
+#define round_down(x, y) ((x) & ~__round_mask(x, y))
+
+#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
+
+#ifndef roundup
+#define roundup(x, y) ( \
+{ \
+ const typeof(y) __y = y; \
+ (((x) + (__y - 1)) / __y) * __y; \
+} \
+)
+#endif
+
+#endif
diff --git a/tools/testing/radix-tree/linux/lockdep.h b/tools/testing/radix-tree/linux/lockdep.h
index 565fccdfe6e95..016cff473cfc4 100644
--- a/tools/testing/radix-tree/linux/lockdep.h
+++ b/tools/testing/radix-tree/linux/lockdep.h
@@ -1,5 +1,8 @@
#ifndef _LINUX_LOCKDEP_H
#define _LINUX_LOCKDEP_H
+
+#include <linux/spinlock.h>
+
struct lock_class_key {
unsigned int a;
};
--
2.33.0
next prev parent reply other threads:[~2021-12-06 21:14 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-06 21:12 [PATCH AUTOSEL 5.15 01/24] drm/msm: Fix null ptr access msm_ioctl_gem_submit() Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 02/24] drm/msm/a6xx: Fix uinitialized use of gpu_scid Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 03/24] drm/msm/dsi: set default num_data_lanes Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 04/24] drm/msm/dp: Avoid unpowered AUX xfers that caused crashes Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 05/24] KVM: arm64: Save PSTATE early on exit Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 06/24] s390/test_unwind: use raw opcode instead of invalid instruction Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 07/24] Revert "tty: serial: fsl_lpuart: drop earlycon entry for i.MX8QXP" Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 08/24] USB: NO_LPM quirk Lenovo Powered USB-C Travel Hub Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 09/24] net/mlx4_en: Update reported link modes for 1/10G Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 10/24] loop: Use pr_warn_once() for loop_control_remove() warning Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 11/24] ALSA: hda: Add Intel DG2 PCI ID and HDMI codec vid Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 12/24] ALSA: hda/hdmi: fix HDA codec entry table order for ADL-P Sasha Levin
2021-12-06 21:12 ` Sasha Levin [this message]
2021-12-06 21:19 ` [PATCH AUTOSEL 5.15 13/24] tools: Fix math.h breakage Matthew Wilcox
2021-12-13 17:10 ` Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 14/24] parisc/agp: Annotate parisc agp init functions with __init Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 15/24] i2c: rk3x: Handle a spurious start completion interrupt flag Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 16/24] net: netlink: af_netlink: Prevent empty skb by adding a check on len Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 17/24] drm/amdgpu: cancel the correct hrtimer on exit Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 18/24] drm/amdgpu: check atomic flag to differeniate with legacy path Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 19/24] drm/amd/display: Fix for the no Audio bug with Tiled Displays Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 20/24] drm/amdkfd: fix double free mem structure Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 21/24] drm/amd/display: add connector type check for CRC source set Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 22/24] drm/amdkfd: process_info lock not needed for svm Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 23/24] tracing: Fix a kmemleak false positive in tracing_map Sasha Levin
2021-12-06 21:12 ` [PATCH AUTOSEL 5.15 24/24] fget: check that the fd still exists after getting a ref to it Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211206211230.1660072-13-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).