ceph-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Zhiyuan Dai <daizhiyuan@phytium.com.cn>,
	jlayton@kernel.org, idryomov@gmail.com
Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ceph: minor coding style tweaks
Date: Wed, 03 Feb 2021 23:34:05 -0800	[thread overview]
Message-ID: <599ba2c6cebb8d8079d6af61d5987b958b2732f8.camel@perches.com> (raw)
In-Reply-To: <1612420334-1112-1-git-send-email-daizhiyuan@phytium.com.cn>

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));
>  }



  reply	other threads:[~2021-02-04  7:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04  6:32 [PATCH] ceph: minor coding style tweaks Zhiyuan Dai
2021-02-04  7:34 ` Joe Perches [this message]
2021-02-04  7:54 Zhiyuan Dai
2021-02-04 12:43 ` Jeff Layton

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=599ba2c6cebb8d8079d6af61d5987b958b2732f8.camel@perches.com \
    --to=joe@perches.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=daizhiyuan@phytium.com.cn \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).