treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / arc / include / asm / mmzone.h
blobb86b9d1e54dc072511d79dab82591664801b6d94
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
4 */
6 #ifndef _ASM_ARC_MMZONE_H
7 #define _ASM_ARC_MMZONE_H
9 #ifdef CONFIG_DISCONTIGMEM
11 extern struct pglist_data node_data[];
12 #define NODE_DATA(nid) (&node_data[nid])
14 static inline int pfn_to_nid(unsigned long pfn)
16 int is_end_low = 1;
18 if (IS_ENABLED(CONFIG_ARC_HAS_PAE40))
19 is_end_low = pfn <= virt_to_pfn(0xFFFFFFFFUL);
22 * node 0: lowmem: 0x8000_0000 to 0xFFFF_FFFF
23 * node 1: HIGHMEM w/o PAE40: 0x0 to 0x7FFF_FFFF
24 * HIGHMEM with PAE40: 0x1_0000_0000 to ...
26 if (pfn >= ARCH_PFN_OFFSET && is_end_low)
27 return 0;
29 return 1;
32 static inline int pfn_valid(unsigned long pfn)
34 int nid = pfn_to_nid(pfn);
36 return (pfn <= node_end_pfn(nid));
38 #endif /* CONFIG_DISCONTIGMEM */
40 #endif