[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <599ba2c6cebb8d8079d6af61d5987b958b2732f8.camel@perches.com>
Date: Wed, 03 Feb 2021 23:34:05 -0800
From: Joe Perches <joe@...ches.com>
To: Zhiyuan Dai <daizhiyuan@...tium.com.cn>, jlayton@...nel.org,
idryomov@...il.com
Cc: ceph-devel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ceph: minor coding style tweaks
On Thu, 2021-02-04 at 14:32 +0800, Zhiyuan Dai wrote:
> Fixed some coding style issues, improve code reading.
Might describe the patch does 3 things:
o Move the pointer location
struct foo* bar; -> struct foo *bar;
o Move brace position
from
struct foo
{
to
struct foo {
o Alignment to open parenthesis
And one more comment:
> diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
[]
> @@ -309,8 +309,8 @@ static int ceph_fill_dirfrag(struct inode *inode,
>
> static int frag_tree_split_cmp(const void *l, const void *r)
> {
> - struct ceph_frag_tree_split *ls = (struct ceph_frag_tree_split*)l;
> - struct ceph_frag_tree_split *rs = (struct ceph_frag_tree_split*)r;
> + struct ceph_frag_tree_split *ls = (struct ceph_frag_tree_split *)l;
> + struct ceph_frag_tree_split *rs = (struct ceph_frag_tree_split *)r;
It's unnecessary to cast void pointers and it's bad form to lose
the const qualifier.
const struct ceph_frag_tree_split *ls = l;
const struct ceph_frag_tree_split *rs = r;
> return ceph_frag_compare(le32_to_cpu(ls->frag),
> le32_to_cpu(rs->frag));
> }
Powered by blists - more mailing lists