From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
To: David Binderman <dcb314@hotmail.com>
Cc: Peng Zhang <zhangpeng.00@bytedance.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"maple-tree@lists.infradead.org" <maple-tree@lists.infradead.org>
Subject: Re: linux-6.3-rc6/lib/maple_tree.c: Two style issues
Date: Mon, 17 Apr 2023 10:58:20 -0400 [thread overview]
Message-ID: <20230417145820.nzmxs42m67pyxpnd@revolver> (raw)
In-Reply-To: <DB6P189MB0568A487A016FBA45DF108A89C959@DB6P189MB0568.EURP189.PROD.OUTLOOK.COM>
* David Binderman <dcb314@hotmail.com> [230417 10:23]:
> Hello there,
>
> >It should be fine here.
>
> Perhaps I have been slightly less than clear. The discussion is about the *style*
> of the code, *not* whether it works or not. My apologies for the lack of clarity.
>
> Expression is
>
> while (A &&
> B && C)
>
> The static analyser notices it is poor style to have B do a limit check, but have A use it.
> Sure its working code, but suggest new code
>
> while (B && A && C)
>
> It won't make much difference to the code, it will merely be better style.
>
> 2.
>
> >> Source code is
> >>
> >> memset(pivs + tmp, 0,
> >> sizeof(unsigned long *) * (max_p - tmp));
>
> >It's not good here, I can fix it.
>
> sizeof( pivs[ 0]) is a better thing to say than sizeof( unsigned long).
> There is reduced future maintenance burden, when the type of *pivs changes.
>
If you want to make the code better, then send a patch. It is very
frustrating to try and decode a compilers output over email and be told
it wasn't decoded to your liking.
This is far more of a maintenance burden than the code you are trying to change.
prev parent reply other threads:[~2023-04-17 14:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-10 7:05 David Binderman
2023-04-10 8:23 ` Peng Zhang
2023-04-17 14:22 ` David Binderman
2023-04-17 14:58 ` Liam R. Howlett [this message]
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=20230417145820.nzmxs42m67pyxpnd@revolver \
--to=liam.howlett@oracle.com \
--cc=dcb314@hotmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=maple-tree@lists.infradead.org \
--cc=zhangpeng.00@bytedance.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