memblock test: compilation fixes

Fix several compilation errors and warnings in memblock tests
 -----BEGIN PGP SIGNATURE-----
 
 iQFEBAABCgAuFiEEeOVYVaWZL5900a/pOQOGJssO/ZEFAmUL2P0QHHJwcHRAa2Vy
 bmVsLm9yZwAKCRA5A4Ymyw79kSniB/9crPnn5y/AvzqA/AiRAvK9pbYj8t3lZyRC
 PFvqHqg6OOQA2AN7VHcxaty6nMYMnr6Myk8lxmY45tpW6wp16XcFtoGYZAllBwTm
 GoqyhRnREDHp7Z0FtKFGcdXm4AYSzEFIlQymoLFJ5S/fGDiBxBd53pacqS0JrL6X
 TKKG1wLPiW9Vq/G90dL6N8qgA4vel9/UoE0aKEWHSEiGhhgcEh+foBoOs0F8DR9y
 o/GZFVJfW5Jek6D7kWzMMq37dPS4TVJWN8df2Q2Ljy5f64i9sT/3rm+/dV6bmarB
 1gjQtI+YoTeu+bZ1I9zJBWwTsMjyjhyZEk1zZxys89+qOnwaCTHF
 =bA+b
 -----END PGP SIGNATURE-----

Merge tag 'fixes-2023-09-21' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock

Pull memblock test fixes from Mike Rapoport:
 "Fix several compilation errors and warnings in memblock tests"

* tag 'fixes-2023-09-21' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock:
  memblock tests: fix warning ‘struct seq_file’ declared inside parameter list
  memblock tests: fix warning: "__ALIGN_KERNEL" redefined
  memblock tests: Fix compilation errors.
This commit is contained in:
Linus Torvalds 2023-09-21 08:21:23 -07:00
commit fb8b1b93ee
6 changed files with 10 additions and 5 deletions

View File

@ -11,8 +11,6 @@
#define PHYS_ADDR_MAX (~(phys_addr_t)0)
#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
#define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
#define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a))
@ -29,7 +27,7 @@ static inline void *phys_to_virt(unsigned long address)
return __va(address);
}
void reserve_bootmem_region(phys_addr_t start, phys_addr_t end);
void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid);
static inline void totalram_pages_inc(void)
{

View File

@ -1,4 +1,6 @@
#ifndef _TOOLS_INCLUDE_LINUX_SEQ_FILE_H
#define _TOOLS_INCLUDE_LINUX_SEQ_FILE_H
struct seq_file;
#endif /* _TOOLS_INCLUDE_LINUX_SEQ_FILE_H */

View File

@ -20,4 +20,8 @@ void memblock_free_pages(struct page *page, unsigned long pfn,
{
}
static inline void accept_memory(phys_addr_t start, phys_addr_t end)
{
}
#endif

View File

@ -11,7 +11,7 @@ struct pglist_data *next_online_pgdat(struct pglist_data *pgdat)
return NULL;
}
void reserve_bootmem_region(phys_addr_t start, phys_addr_t end)
void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid)
{
}

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include "basic_api.h"
#include <string.h>
#include <linux/memblock.h>
#include "basic_api.h"
#define EXPECTED_MEMBLOCK_REGIONS 128
#define FUNC_ADD "memblock_add"

View File

@ -5,6 +5,7 @@
#include <stdlib.h>
#include <assert.h>
#include <linux/types.h>
#include <linux/seq_file.h>
#include <linux/memblock.h>
#include <linux/sizes.h>
#include <linux/printk.h>