Commit 4f0a8fe3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull memblock fixes from Mike Rapoport:
 "Fix build errors in memblock tests:

   - add stubs to functions that calls to them were recently added to
     memblock but they were missing in tests

   - update gfp_types.h to include bits.h so that BIT() definitions
     won't depend on other includes"

* tag 'fixes-2024-04-08' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock:
  memblock tests: fix undefined reference to `BIT'
  memblock tests: fix undefined reference to `panic'
  memblock tests: fix undefined reference to `early_pfn_to_nid'
parents fec50db7 592447f6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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
/**
+1 −0
Original line number Diff line number Diff line
@@ -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>

+5 −0
Original line number Diff line number Diff line
@@ -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
+19 −0
Original line number Diff line number Diff line
/* 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