Skip to content

Commit bb077c3

Browse files
Kefeng Wangakpm00
authored andcommitted
mm: cleanup is_highmem()
It is unnecessary to add CONFIG_HIGHMEM check in is_highmem(), which has been done in is_highmem_idx(), and move is_highmem() close to is_highmem_idx(). This has no functional impact. Link: https://lkml.kernel.org/r/20220726131816.149075-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent f6c3e1a commit bb077c3

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

include/linux/mmzone.h

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,15 +1137,6 @@ static inline int is_highmem_idx(enum zone_type idx)
11371137
#endif
11381138
}
11391139

1140-
#ifdef CONFIG_ZONE_DMA
1141-
bool has_managed_dma(void);
1142-
#else
1143-
static inline bool has_managed_dma(void)
1144-
{
1145-
return false;
1146-
}
1147-
#endif
1148-
11491140
/**
11501141
* is_highmem - helper function to quickly check if a struct zone is a
11511142
* highmem zone or not. This is an attempt to keep references
@@ -1155,12 +1146,17 @@ static inline bool has_managed_dma(void)
11551146
*/
11561147
static inline int is_highmem(struct zone *zone)
11571148
{
1158-
#ifdef CONFIG_HIGHMEM
11591149
return is_highmem_idx(zone_idx(zone));
1150+
}
1151+
1152+
#ifdef CONFIG_ZONE_DMA
1153+
bool has_managed_dma(void);
11601154
#else
1161-
return 0;
1162-
#endif
1155+
static inline bool has_managed_dma(void)
1156+
{
1157+
return false;
11631158
}
1159+
#endif
11641160

11651161
/* These two functions are used to setup the per zone pages min values */
11661162
struct ctl_table;

0 commit comments

Comments
 (0)