From: Christos Skarlos <christosskarlos.kernel@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Christos Skarlos <christosskarlos.kernel@gmail.com>
Subject: [PATCH] mm/page_alloc: fix various coding style warnings
Date: Tue, 1 Sep 2026 17:15:04 +0300 [thread overview]
Message-ID: <20260901141504.1518-1-christosskarlos.kernel@gmail.com> (raw)
Resolve several coding style issues flagged by checkpatch.pl:
- Replace spaces with tabs for proper code indentation.
- Add missing blank lines after variable declarations.
- Replace bare 'unsigned' with 'unsigned int'.
- Fix suspect code indentation in conditional statements.
No functional changes are introduced.
Signed-off-by: Christos Skarlos <christosskarlos.kernel@gmail.com>
---
mm/page_alloc.c | 42 +++++++++++++++++++++++-------------------
1 file changed, 23 insertions(+), 19 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 12fac9084c48..7c9152c58084 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -575,7 +575,7 @@ void __meminit init_pageblock_migratetype(struct page *page,
static int page_outside_zone_boundaries(struct zone *zone, struct page *page)
{
int ret;
- unsigned seq;
+ unsigned int seq;
unsigned long pfn = page_to_pfn(page);
unsigned long sp, start_pfn;
@@ -846,7 +846,7 @@ static inline void __del_page_from_free_list(struct page *page, struct zone *zon
{
int nr_pages = 1 << order;
- VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
+ VM_WARN_ONCE(get_pageblock_migratetype(page) != migratetype,
"page type is %d, passed migratetype is %d (nr=%d)\n",
get_pageblock_migratetype(page), migratetype, nr_pages);
@@ -2927,6 +2927,7 @@ static bool free_frozen_page_commit(struct zone *zone,
zone_watermark_ok(zone, 0, high_wmark_pages(zone),
ZONE_MOVABLE, 0)) {
struct pglist_data *pgdat = zone->zone_pgdat;
+
clear_bit(ZONE_BELOW_HIGH, &zone->flags);
/*
@@ -3155,6 +3156,7 @@ int __isolate_free_page(struct page *page, unsigned int order)
*/
if (order >= pageblock_order - 1) {
struct page *endpage = page + (1 << order) - 1;
+
for (; page < endpage; page += pageblock_nr_pages) {
int mt = get_pageblock_migratetype(page);
/*
@@ -3821,9 +3823,9 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
unsigned long mark;
if (cpusets_enabled() &&
- (alloc_flags & ALLOC_CPUSET) &&
- !__cpuset_zone_allowed(zone, gfp_mask))
- continue;
+ (alloc_flags & ALLOC_CPUSET) &&
+ !__cpuset_zone_allowed(zone, gfp_mask))
+ continue;
/*
* When allocating a page cache page for writing, we
* want to get it from a node that is within its dirty
@@ -3943,16 +3945,16 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
prep_new_page(page, order, gfp_mask, alloc_flags);
return page;
- } else {
- if (cond_accept_memory(zone, order, alloc_flags))
- goto try_this_zone;
+ }
+ if (cond_accept_memory(zone, order, alloc_flags))
+ goto try_this_zone;
- /* Try again if zone has deferred pages */
- if (deferred_pages_enabled()) {
- if (_deferred_grow_zone(zone, order))
- goto try_this_zone;
+ /* Try again if zone has deferred pages */
+ if (deferred_pages_enabled()) {
+ if (_deferred_grow_zone(zone, order))
+ goto try_this_zone;
}
- }
+
}
/*
@@ -4637,7 +4639,7 @@ bool gfp_pfmemalloc_allowed(gfp_t gfp_mask)
* Returns true if a retry is viable or false to enter the oom path.
*/
static inline bool
-should_reclaim_retry(gfp_t gfp_mask, unsigned order,
+should_reclaim_retry(gfp_t gfp_mask, unsigned int order,
struct alloc_context *ac, int alloc_flags,
bool did_some_progress, int *no_progress_loops)
{
@@ -4673,9 +4675,9 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order,
bool wmark;
if (cpusets_enabled() &&
- (alloc_flags & ALLOC_CPUSET) &&
- !__cpuset_zone_allowed(zone, gfp_mask))
- continue;
+ (alloc_flags & ALLOC_CPUSET) &&
+ !__cpuset_zone_allowed(zone, gfp_mask))
+ continue;
available = reclaimable = zone_reclaimable_pages(zone);
available += zone_page_state_snapshot(zone, NR_FREE_PAGES);
@@ -5713,6 +5715,7 @@ static unsigned long nr_free_zone_pages(int offset)
for_each_zone_zonelist(zone, z, zonelist, offset) {
unsigned long size = zone_managed_pages(zone);
unsigned long high = high_wmark_pages(zone);
+
if (size > high)
sum += size - high;
}
@@ -5865,7 +5868,7 @@ int find_next_best_node(int node, nodemask_t *used_node_mask)
* DMA zone, if any--but risks exhausting DMA zone.
*/
static void build_zonelists_in_node_order(pg_data_t *pgdat, int *node_order,
- unsigned nr_nodes)
+ unsigned int nr_nodes)
{
struct zoneref *zonerefs;
int i;
@@ -6393,6 +6396,7 @@ void __init setup_per_cpu_pageset(void)
*/
for_each_possible_cpu(cpu) {
struct per_cpu_zonestat *pzstats = &per_cpu(boot_zonestats, cpu);
+
memset(pzstats->vm_numa_event, 0,
sizeof(pzstats->vm_numa_event));
}
@@ -6803,7 +6807,7 @@ static void setup_min_unmapped_ratio(void)
for_each_zone(zone)
zone->zone_pgdat->min_unmapped_pages += (zone_managed_pages(zone) *
- sysctl_min_unmapped_ratio) / 100;
+ sysctl_min_unmapped_ratio) / 100;
}
--
2.50.1 (Apple Git-155)
reply other threads:[~2026-09-01 14:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260901141504.1518-1-christosskarlos.kernel@gmail.com \
--to=christosskarlos.kernel@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®