linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] pagevec.h: add `const` to pointer parameters of getter functions
@ 2025-08-28 13:03 Max Kellermann
  2025-08-28 13:18 ` Matthew Wilcox
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Max Kellermann @ 2025-08-28 13:03 UTC (permalink / raw)
  To: akpm, david, lorenzo.stoakes, linux-mm, linux-kernel; +Cc: Max Kellermann

For improved const-correctness.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
---
v1->v2: reduced patch to just pagevec.h upon David Hildenbrand's suggestion
---
 include/linux/pagevec.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h
index 5d3a0cccc6bf..63be5a451627 100644
--- a/include/linux/pagevec.h
+++ b/include/linux/pagevec.h
@@ -51,12 +51,12 @@ static inline void folio_batch_reinit(struct folio_batch *fbatch)
 	fbatch->i = 0;
 }
 
-static inline unsigned int folio_batch_count(struct folio_batch *fbatch)
+static inline unsigned int folio_batch_count(const struct folio_batch *fbatch)
 {
 	return fbatch->nr;
 }
 
-static inline unsigned int folio_batch_space(struct folio_batch *fbatch)
+static inline unsigned int folio_batch_space(const struct folio_batch *fbatch)
 {
 	return PAGEVEC_SIZE - fbatch->nr;
 }
-- 
2.47.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-08-28 16:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28 13:03 [PATCH v2] pagevec.h: add `const` to pointer parameters of getter functions Max Kellermann
2025-08-28 13:18 ` Matthew Wilcox
2025-08-28 13:23 ` Vlastimil Babka
2025-08-28 14:12   ` Max Kellermann
2025-08-28 13:26 ` Lorenzo Stoakes
2025-08-28 16:10 ` Vishal Moola (Oracle)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).