From: David Hildenbrand <david@redhat.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Huacai Chen <chenhuacai@kernel.org>,
Huacai Chen <chenhuacai@loongson.cn>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, Zi Yan <ziy@nvidia.com>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
Harry Yoo <harry.yoo@oracle.com>,
linux-kernel@vger.kernel.org, Minchan Kim <minchan@kernel.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH] mm/migrate: Fix NULL movable_ops if CONFIG_ZSMALLOC=m
Date: Sat, 16 Aug 2025 19:04:01 +0200 [thread overview]
Message-ID: <07b17e1c-92e6-432a-9af6-13d3fc8246bc@redhat.com> (raw)
In-Reply-To: <e06f23d9-adcf-4d0a-8ba1-bda6d4b483b1@redhat.com>
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
next prev parent reply other threads:[~2025-08-16 17:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-15 9:05 [PATCH] mm/migrate: Fix NULL movable_ops if CONFIG_ZSMALLOC=m Huacai Chen
2025-08-15 20:57 ` Zi Yan
2025-08-16 0:57 ` kernel test robot
2025-08-16 7:22 ` David Hildenbrand
2025-08-16 8:57 ` Huacai Chen
2025-08-16 9:01 ` David Hildenbrand
2025-08-16 10:54 ` David Hildenbrand
2025-08-16 16:23 ` Matthew Wilcox
2025-08-16 17:02 ` David Hildenbrand
2025-08-16 17:04 ` David Hildenbrand [this message]
2025-08-17 1:37 ` Huacai Chen
2025-08-17 8:04 ` David Hildenbrand
2025-08-17 8:34 ` Huacai Chen
2025-08-16 17:13 ` David Hildenbrand
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=07b17e1c-92e6-432a-9af6-13d3fc8246bc@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=harry.yoo@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=minchan@kernel.org \
--cc=mst@redhat.com \
--cc=senozhatsky@chromium.org \
--cc=willy@infradead.org \
--cc=ziy@nvidia.com \
/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;
as well as URLs for NNTP newsgroup(s).