From: Luis de Bethencourt <luisbg@osg.samsung.com>
To: Salah Triki <salah.triki@gmail.com>,
akpm@linux-foundation.org, viro@zeniv.linux.org.uk
Cc: mhocko@suse.com, vdavydov@virtuozzo.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] fs: befs: Coding style fix
Date: Sat, 02 Jul 2016 12:22:01 +0100 [thread overview]
Message-ID: <5777A3D9.90808@osg.samsung.com> (raw)
In-Reply-To: <6e5ad0148ac892de0e7ceaa7e9bc757e164c292f.1467446561.git.salah.triki@gmail.com>
On 02/07/16 09:05, Salah Triki wrote:
> Constant has to be capitalized.
>
> Signed-off-by: Salah Triki <salah.triki@gmail.com>
> ---
> fs/befs/btree.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/befs/btree.c b/fs/befs/btree.c
> index 307645f9..e59ad20 100644
> --- a/fs/befs/btree.c
> +++ b/fs/befs/btree.c
> @@ -85,7 +85,7 @@ struct befs_btree_node {
> };
>
> /* local constants */
> -static const befs_off_t befs_bt_inval = 0xffffffffffffffffULL;
> +static const befs_off_t BEFS_BT_INVAL = 0xffffffffffffffffULL;
>
> /* local functions */
> static int befs_btree_seekleaf(struct super_block *sb, const befs_data_stream *ds,
> @@ -467,7 +467,7 @@ befs_btree_read(struct super_block *sb, const befs_data_stream *ds,
> while (key_sum + this_node->head.all_key_count <= key_no) {
>
> /* no more nodes to look in: key_no is too large */
> - if (this_node->head.right == befs_bt_inval) {
> + if (this_node->head.right == BEFS_BT_INVAL) {
> *keysize = 0;
> *value = 0;
> befs_debug(sb,
> @@ -608,7 +608,7 @@ static int
> befs_leafnode(struct befs_btree_node *node)
> {
> /* all interior nodes (and only interior nodes) have an overflow node */
> - if (node->head.overflow == befs_bt_inval)
> + if (node->head.overflow == BEFS_BT_INVAL)
> return 1;
> else
> return 0;
>
Hi Salah,
What the coding style says is:
"Names of macros defining constants and labels in enums are capitalized."
Even though this isn't a macro, when reading the code it is good to know it is
almost like one. I agree this makes the code more readable.
Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Thanks,
Luis
next prev parent reply other threads:[~2016-07-02 11:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-02 8:05 [PATCH 1/4] fs: befs: Remove redundant validation from befs_find_brun_direct Salah Triki
2016-07-02 8:05 ` [PATCH 2/4] fs: befs: Coding style fix Salah Triki
2016-07-02 11:22 ` Luis de Bethencourt [this message]
2016-07-02 8:05 ` [PATCH 3/4] fs: befs: Remove useless calls to brelse in befs_find_brun_dblindirect Salah Triki
2016-07-02 11:51 ` Luis de Bethencourt
2016-07-02 8:05 ` [PATCH 4/4] fs: befs: Remove goto from befs_bread_iaddr Salah Triki
2016-07-02 12:04 ` Luis de Bethencourt
2016-07-02 11:38 ` [PATCH 1/4] fs: befs: Remove redundant validation from befs_find_brun_direct Luis de Bethencourt
2016-07-02 13:34 ` Salah Triki
2016-07-02 14:44 ` Luis de Bethencourt
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=5777A3D9.90808@osg.samsung.com \
--to=luisbg@osg.samsung.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.com \
--cc=salah.triki@gmail.com \
--cc=vdavydov@virtuozzo.com \
--cc=viro@zeniv.linux.org.uk \
/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
Powered by JetHome