From: Joe Perches <joe@perches.com>
To: "Zoltán Lajos Kis" <zoltan.lajos.kis@gmail.com>
Cc: oleg.drokin@intel.com, andreas.dilger@intel.com,
gregkh@linuxfoundation.org, Julia.Lawall@lip6.fr,
kumari.radha3@gmail.com, mahfouz.saif.elyazal@gmail.com,
gdonald@gmail.com, HPDD-discuss@ml01.01.org,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] Staging: lustre: fix braces are not necessary in dt_object.c
Date: Wed, 10 Jun 2015 13:11:35 -0700 [thread overview]
Message-ID: <1433967095.32331.30.camel@perches.com> (raw)
In-Reply-To: <1433966417-21638-3-git-send-email-zoltan.lajos.kis@gmail.com>
On Wed, 2015-06-10 at 22:00 +0200, Zoltán Lajos Kis wrote:
> Fixes a braces {} are not necessary for any arm of this statement
> warning in lustre/lustre/obdclass/dt_object.c that was found by
> the checkpatch.pl tool.
>
> Signed-off-by: Zoltán Lajos Kis <zoltan.lajos.kis@gmail.com>
> ---
> drivers/staging/lustre/lustre/obdclass/dt_object.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/obdclass/dt_object.c b/drivers/staging/lustre/lustre/obdclass/dt_object.c
> index 4b5c828d..46fbf21 100644
> --- a/drivers/staging/lustre/lustre/obdclass/dt_object.c
> +++ b/drivers/staging/lustre/lustre/obdclass/dt_object.c
> @@ -329,9 +329,9 @@ static struct dt_object *dt_reg_open(const struct lu_env *env,
> int result;
>
> result = dt_lookup_dir(env, p, name, fid);
> - if (result == 0){
> + if (result == 0)
> o = dt_locate(env, dt, fid);
> - } else
> + else
> o = ERR_PTR(result);
>
> return o;
My preference for this sort of thing is generally:
static struct dt_object *dt_reg_open(const struct lu_env *env,
struct dt_device *dt,
struct dt_object *p,
const char *name,
struct lu_fid *fid)
{
int result;
result = dt_lookup_dir(env, p, name, fid);
if (result)
return ERR_PTR(result);
return dt_locate(env, dt, fid);
}
next prev parent reply other threads:[~2015-06-10 20:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Message-Id: <1432999722-8407-1-git-send-email-zoltan.lajos.kis@gmail.com>
2015-06-10 20:00 ` [PATCH v2 0/3] Staging: lustre: fix style issues " Zoltán Lajos Kis
2015-06-10 20:00 ` [PATCH v2 1/3] Staging: lustre: fix line over 80 characters " Zoltán Lajos Kis
2015-06-10 20:00 ` [PATCH v2 2/3] Staging: lustre: fix braces are not necessary " Zoltán Lajos Kis
2015-06-10 20:11 ` Joe Perches [this message]
2015-06-10 20:00 ` [PATCH v2 3/3] Staging: lustre: fix space before and after comma " Zoltán Lajos Kis
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=1433967095.32331.30.camel@perches.com \
--to=joe@perches.com \
--cc=HPDD-discuss@ml01.01.org \
--cc=Julia.Lawall@lip6.fr \
--cc=andreas.dilger@intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=gdonald@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kumari.radha3@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mahfouz.saif.elyazal@gmail.com \
--cc=oleg.drokin@intel.com \
--cc=zoltan.lajos.kis@gmail.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
Powered by JetHome