mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Andy Whitcroft <apw@canonical.com>,
	Srikrishan Malik <srikrishanmalik@gmail.com>,
	greg@kroah.com, andreas.dilger@intel.com, oleg.drokin@intel.com,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 05/12] staging: lustre: Add missing spaces around operators and braces.
Date: Wed, 06 Aug 2014 14:26:02 -0700	[thread overview]
Message-ID: <1407360362.2736.13.camel@joe-AO725> (raw)
In-Reply-To: <20140806204528.GB11899@mwanda>

On Wed, 2014-08-06 at 23:45 +0300, Dan Carpenter wrote:
> On Wed, Aug 06, 2014 at 01:31:46PM -0700, Joe Perches wrote:
> > On Wed, 2014-08-06 at 23:13 +0300, Dan Carpenter wrote:
> > > On Wed, Aug 06, 2014 at 10:42:55PM +0530, Srikrishan Malik wrote:
> > > > diff --git a/drivers/staging/lustre/lustre/mdc/mdc_reint.c b/drivers/staging/lustre/lustre/mdc/mdc_reint.c
> > []
> > > > @@ -71,7 +71,7 @@ int mdc_resource_get_unused(struct obd_export *exp, const struct lu_fid *fid,
> > > >  			    __u64 bits)
> > > >  {
> > > >  	struct ldlm_namespace *ns = exp->exp_obd->obd_namespace;
> > > > -	ldlm_policy_data_t policy = {{0}};
> > > > +	ldlm_policy_data_t policy = {{0} };
> > > 
> > > That's odd.  Since when is a space required here?  Anyway, put one at
> > > the start too if you're goind to do that.  Or you could do it like:
> > > 
> > > 	ldlm_policy_data_t policy = {};
> > > 
> > > ?
> > 
> > It comes from a pretty old bit of checkpatch:
> > 
> > de7d4f0e (Andy Whitcroft 2007-07-15 23:37:22 -0700 3706) # closing brace should have a space following it when it has anything
> > de7d4f0e (Andy Whitcroft 2007-07-15 23:37:22 -0700 3707) # on the line
> > de7d4f0e (Andy Whitcroft 2007-07-15 23:37:22 -0700 3708)                if ($line =~ /}(?!(?:,|;|\)))\S/) {
> > 
> > Maybe it should have an } added to the test like:
> > 
> > if ($line =~ /}(?!(?:,|;|\)|}))\S/) {
> >
> 
> Yes.  It feels like '}}' is common.

I think so too.  Also, there isn't an equivalent
test for '{{' so warning on '}}' seems silly.

> Also it should ignore \. because this used for:
> 
> ERROR: space required after that close brace '}'
> #118: FILE: ./drivers/gpu/drm/nouveau/core/engine/disp/nva3.c:118:
> +}.base.base;
> 
> Otherwise this test is legit and complains about bad typedefs and
> '}else{' statements.

I don't think \. should be added myself.

Only nouveau uses that style.

I think all of those nouveau uses are not
very nice and they should be changed instead
or the warnings should just be ignored there.

Andy?


  reply	other threads:[~2014-08-06 21:26 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06 17:12 [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Srikrishan Malik
2014-08-06 17:12 ` [PATCH 02/12] staging: lustre: remove spaces from start of line Srikrishan Malik
2014-08-06 17:12 ` [PATCH 03/12] staging: lustre: move open brace to next line after functions Srikrishan Malik
2014-08-06 17:12 ` [PATCH 04/12] staging: lustre: fix lines over 80 chars Srikrishan Malik
2014-08-06 17:12 ` [PATCH 05/12] staging: lustre: Add missing spaces around operators and braces Srikrishan Malik
2014-08-06 20:13   ` Dan Carpenter
2014-08-06 20:31     ` Joe Perches
2014-08-06 20:45       ` Dan Carpenter
2014-08-06 21:26         ` Joe Perches [this message]
2014-08-06 17:12 ` [PATCH 06/12] staging: lustre: replace c99 style comments with C89 Srikrishan Malik
2014-08-06 20:15   ` Dan Carpenter
2014-08-06 17:12 ` [PATCH 07/12] staging: lustre: add blank lines after declarations Srikrishan Malik
2014-08-06 17:12 ` [PATCH 08/12] staging: lustre: fix multi line strings Srikrishan Malik
2014-08-06 17:12 ` [PATCH 09/12] staging: lustre: Added space between type name and * Srikrishan Malik
2014-08-06 17:13 ` [PATCH 10/12] staging: lustre: Fix misplaced opening brace warnings Srikrishan Malik
2014-08-06 20:18   ` Dan Carpenter
2014-08-07 15:31     ` Srikrishan Malik
2014-08-07 16:01       ` Dan Carpenter
2014-08-07 16:35         ` Joe Perches
2014-08-11 10:57           ` Srikrishan Malik
2014-08-11 11:36             ` Joe Perches
2014-08-11 14:21               ` Julia Lawall
2014-08-11 12:54             ` Dan Carpenter
2014-08-06 17:13 ` [PATCH 11/12] staging: lustre: move else on the same line as closing brace Srikrishan Malik
2014-08-06 17:13 ` [PATCH 12/12] staging: lustre: remove parentheses usage with return Srikrishan Malik
2014-08-10  4:32 ` [PATCH 01/12] staging: lustre: remove space between function name and and open parenthesis Greg KH
2014-08-10 14:43   ` Srikrishan Malik

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=1407360362.2736.13.camel@joe-AO725 \
    --to=joe@perches.com \
    --cc=andreas.dilger@intel.com \
    --cc=apw@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg.drokin@intel.com \
    --cc=srikrishanmalik@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

all inboxes | Powered by JetHome®