linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] memblock tests: fix build error
@ 2024-04-02 13:26 Wei Yang
  2024-04-02 13:26 ` [PATCH 1/3] memblock tests: fix undefined reference to `early_pfn_to_nid' Wei Yang
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Wei Yang @ 2024-04-02 13:26 UTC (permalink / raw)
  To: akpm, rppt, rongtao; +Cc: linux-kernel, linux-mm, Wei Yang

Some kernel change break the test build, just fix it.

Wei Yang (3):
  memblock tests: fix undefined reference to `early_pfn_to_nid'
  memblock tests: fix undefined reference to `panic'
  memblock tests: fix undefined reference to `BIT'

 include/linux/gfp_types.h    |  2 ++
 tools/include/linux/kernel.h |  1 +
 tools/include/linux/mm.h     |  5 +++++
 tools/include/linux/panic.h  | 19 +++++++++++++++++++
 4 files changed, 27 insertions(+)
 create mode 100644 tools/include/linux/panic.h

-- 
2.34.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] memblock tests: fix undefined reference to `early_pfn_to_nid'
  2024-04-02 13:26 [PATCH 0/3] memblock tests: fix build error Wei Yang
@ 2024-04-02 13:26 ` Wei Yang
  2024-04-02 13:27 ` [PATCH 2/3] memblock tests: fix undefined reference to `panic' Wei Yang
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Wei Yang @ 2024-04-02 13:26 UTC (permalink / raw)
  To: akpm, rppt, rongtao; +Cc: linux-kernel, linux-mm, Wei Yang, Yajun Deng

commit 6a9531c3a880 ("memblock: fix crash when reserved memory is not
added to memory") introduce the usage of early_pfn_to_nid, which is not
defined in memblock tests.

The original definition of early_pfn_to_nid is defined in mm.h, so let
add this in the corresponding mm.h.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Yajun Deng <yajun.deng@linux.dev>
CC: Mike Rapoport <rppt@kernel.org>
---
 tools/include/linux/mm.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/include/linux/mm.h b/tools/include/linux/mm.h
index f3c82ab5b14c..7d73da098047 100644
--- a/tools/include/linux/mm.h
+++ b/tools/include/linux/mm.h
@@ -37,4 +37,9 @@ static inline void totalram_pages_add(long count)
 {
 }
 
+static inline int early_pfn_to_nid(unsigned long pfn)
+{
+	return 0;
+}
+
 #endif
-- 
2.34.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/3] memblock tests: fix undefined reference to `panic'
  2024-04-02 13:26 [PATCH 0/3] memblock tests: fix build error Wei Yang
  2024-04-02 13:26 ` [PATCH 1/3] memblock tests: fix undefined reference to `early_pfn_to_nid' Wei Yang
@ 2024-04-02 13:27 ` Wei Yang
  2024-04-02 13:27 ` [PATCH 3/3] memblock tests: fix undefined reference to `BIT' Wei Yang
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Wei Yang @ 2024-04-02 13:27 UTC (permalink / raw)
  To: akpm, rppt, rongtao; +Cc: linux-kernel, linux-mm, Wei Yang, Song Shuai

commit e96c6b8f212a ("memblock: report failures when memblock_can_resize
is not set") introduced the usage of panic, which is not defined in
memblock test.

Let's define it directly in panic.h to fix it.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Song Shuai <songshuaishuai@tinylab.org>
CC: Mike Rapoport <rppt@kernel.org>
---
 tools/include/linux/kernel.h |  1 +
 tools/include/linux/panic.h  | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 tools/include/linux/panic.h

diff --git a/tools/include/linux/kernel.h b/tools/include/linux/kernel.h
index 4b0673bf52c2..07cfad817d53 100644
--- a/tools/include/linux/kernel.h
+++ b/tools/include/linux/kernel.h
@@ -8,6 +8,7 @@
 #include <linux/build_bug.h>
 #include <linux/compiler.h>
 #include <linux/math.h>
+#include <linux/panic.h>
 #include <endian.h>
 #include <byteswap.h>
 
diff --git a/tools/include/linux/panic.h b/tools/include/linux/panic.h
new file mode 100644
index 000000000000..9c8f17a41ce8
--- /dev/null
+++ b/tools/include/linux/panic.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _TOOLS_LINUX_PANIC_H
+#define _TOOLS_LINUX_PANIC_H
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+static inline void panic(const char *fmt, ...)
+{
+	va_list argp;
+
+	va_start(argp, fmt);
+	vfprintf(stderr, fmt, argp);
+	va_end(argp);
+	exit(-1);
+}
+
+#endif
-- 
2.34.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 3/3] memblock tests: fix undefined reference to `BIT'
  2024-04-02 13:26 [PATCH 0/3] memblock tests: fix build error Wei Yang
  2024-04-02 13:26 ` [PATCH 1/3] memblock tests: fix undefined reference to `early_pfn_to_nid' Wei Yang
  2024-04-02 13:27 ` [PATCH 2/3] memblock tests: fix undefined reference to `panic' Wei Yang
@ 2024-04-02 13:27 ` Wei Yang
  2024-04-02 19:09 ` [PATCH 0/3] memblock tests: fix build error Mike Rapoport
  2024-04-04  9:31 ` Mike Rapoport
  4 siblings, 0 replies; 7+ messages in thread
From: Wei Yang @ 2024-04-02 13:27 UTC (permalink / raw)
  To: akpm, rppt, rongtao
  Cc: linux-kernel, linux-mm, Wei Yang, Suren Baghdasaryan, Michal Hocko

commit 772dd0342727 ("mm: enumerate all gfp flags") define gfp flags
with the help of BIT, while gfp_types.h doesn't include header file for
the definition. This through an error on building memblock tests.

Let's include linux/bits.h to fix it.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Suren Baghdasaryan <surenb@google.com>
CC: Michal Hocko <mhocko@suse.com>
---
 include/linux/gfp_types.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/gfp_types.h b/include/linux/gfp_types.h
index 868c8fb1bbc1..13becafe41df 100644
--- a/include/linux/gfp_types.h
+++ b/include/linux/gfp_types.h
@@ -2,6 +2,8 @@
 #ifndef __LINUX_GFP_TYPES_H
 #define __LINUX_GFP_TYPES_H
 
+#include <linux/bits.h>
+
 /* The typedef is in types.h but we want the documentation here */
 #if 0
 /**
-- 
2.34.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/3] memblock tests: fix build error
  2024-04-02 13:26 [PATCH 0/3] memblock tests: fix build error Wei Yang
                   ` (2 preceding siblings ...)
  2024-04-02 13:27 ` [PATCH 3/3] memblock tests: fix undefined reference to `BIT' Wei Yang
@ 2024-04-02 19:09 ` Mike Rapoport
  2024-04-03 22:30   ` Andrew Morton
  2024-04-04  9:31 ` Mike Rapoport
  4 siblings, 1 reply; 7+ messages in thread
From: Mike Rapoport @ 2024-04-02 19:09 UTC (permalink / raw)
  To: Wei Yang, Andrew Morton; +Cc: rongtao, linux-kernel, linux-mm

On Tue, Apr 02, 2024 at 01:26:58PM +0000, Wei Yang wrote:
> Some kernel change break the test build, just fix it.
> 
> Wei Yang (3):
>   memblock tests: fix undefined reference to `early_pfn_to_nid'
>   memblock tests: fix undefined reference to `panic'
>   memblock tests: fix undefined reference to `BIT'
> 
>  include/linux/gfp_types.h    |  2 ++
>  tools/include/linux/kernel.h |  1 +
>  tools/include/linux/mm.h     |  5 +++++
>  tools/include/linux/panic.h  | 19 +++++++++++++++++++
>  4 files changed, 27 insertions(+)
>  create mode 100644 tools/include/linux/panic.h

Andrew,

I can take these via memblock tree, what is your preference?

-- 
Sincerely yours,
Mike.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/3] memblock tests: fix build error
  2024-04-02 19:09 ` [PATCH 0/3] memblock tests: fix build error Mike Rapoport
@ 2024-04-03 22:30   ` Andrew Morton
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Morton @ 2024-04-03 22:30 UTC (permalink / raw)
  To: Mike Rapoport; +Cc: Wei Yang, rongtao, linux-kernel, linux-mm

On Tue, 2 Apr 2024 22:09:47 +0300 Mike Rapoport <rppt@kernel.org> wrote:

> On Tue, Apr 02, 2024 at 01:26:58PM +0000, Wei Yang wrote:
> > Some kernel change break the test build, just fix it.
> > 
> > Wei Yang (3):
> >   memblock tests: fix undefined reference to `early_pfn_to_nid'
> >   memblock tests: fix undefined reference to `panic'
> >   memblock tests: fix undefined reference to `BIT'
> > 
> >  include/linux/gfp_types.h    |  2 ++
> >  tools/include/linux/kernel.h |  1 +
> >  tools/include/linux/mm.h     |  5 +++++
> >  tools/include/linux/panic.h  | 19 +++++++++++++++++++
> >  4 files changed, 27 insertions(+)
> >  create mode 100644 tools/include/linux/panic.h
> 
> Andrew,
> 
> I can take these via memblock tree, what is your preference?

I'm seeing no conflicts at this time, so go for it.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/3] memblock tests: fix build error
  2024-04-02 13:26 [PATCH 0/3] memblock tests: fix build error Wei Yang
                   ` (3 preceding siblings ...)
  2024-04-02 19:09 ` [PATCH 0/3] memblock tests: fix build error Mike Rapoport
@ 2024-04-04  9:31 ` Mike Rapoport
  4 siblings, 0 replies; 7+ messages in thread
From: Mike Rapoport @ 2024-04-04  9:31 UTC (permalink / raw)
  To: akpm, rongtao, Wei Yang; +Cc: linux-kernel, linux-mm

On Tue, 02 Apr 2024 13:26:58 +0000, Wei Yang wrote:
> Some kernel change break the test build, just fix it.
> 
> Wei Yang (3):
>   memblock tests: fix undefined reference to `early_pfn_to_nid'
>   memblock tests: fix undefined reference to `panic'
>   memblock tests: fix undefined reference to `BIT'
> 
> [...]

Applied to fixes branch of memblock.git tree, thanks!

[1/3] memblock tests: fix undefined reference to `early_pfn_to_nid'
      commit: 7d8ed162e6a92268d4b2b84d364a931216102c8e
[2/3] memblock tests: fix undefined reference to `panic'
      commit: e0f5a8e74be88f2476e58b25d3b49a9521bdc4ec
[3/3] memblock tests: fix undefined reference to `BIT'
      commit: 592447f6cb3c20d606d6c5d8e6af68e99707b786

tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock
branch: fixes

--
Sincerely yours,
Mike.




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-04-04  9:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-02 13:26 [PATCH 0/3] memblock tests: fix build error Wei Yang
2024-04-02 13:26 ` [PATCH 1/3] memblock tests: fix undefined reference to `early_pfn_to_nid' Wei Yang
2024-04-02 13:27 ` [PATCH 2/3] memblock tests: fix undefined reference to `panic' Wei Yang
2024-04-02 13:27 ` [PATCH 3/3] memblock tests: fix undefined reference to `BIT' Wei Yang
2024-04-02 19:09 ` [PATCH 0/3] memblock tests: fix build error Mike Rapoport
2024-04-03 22:30   ` Andrew Morton
2024-04-04  9:31 ` Mike Rapoport

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox