Re: [PATCH] mm/migrate: Fix NULL movable_ops if CONFIG_ZSMALLOC=m
From: David Hildenbrand
Date: Sat Aug 16 2025 - 13:04:21 EST
On 16.08.25 19:02, David Hildenbrand wrote:
On 16.08.25 18:23, Matthew Wilcox wrote:
On Sat, Aug 16, 2025 at 12:54:52PM +0200, David Hildenbrand wrote:
+++ b/mm/balloon_compaction.c
@@ -256,8 +256,10 @@ const struct movable_operations balloon_mops = {
static int __init balloon_init(void)
{
- movable_ops[MOVABLE_BALLOON] = &balloon_mops;
- return 0;
+ int rc;
+
+ rc = register_movable_ops(&balloon_mops, PGTY_offline);
+ return rc;
Using 'rc' as the name of this variable is an anti-pattern. All it
tells you is "this is the return value". Calling it 'err' is far
better because now we know it's an error number (or zero for success,
of course).
I know, we all have our things to complain about. Some about Cc: above
--, others about the name of error variables :P
$ git grep "int rc" | wc -l
12730
$ git grep "int ret" | wc -l
80386
$ git grep "int error" | wc -l
4349
$ git grep "int err " | wc -l
6117
It seems to be a particularly IBM derived antipattern ;-)
Careful miser :D
"mister". No idea if "miser" exist and if so, whether it could be
considered offensive ;)
--
Cheers
David / dhildenb