[CRIU] Re: [PATCH 08/14] files: Add a few missing brackets

Cyrill Gorcunov gorcunov at openvz.org
Wed Sep 5 12:58:44 EDT 2012


On Wed, Sep 05, 2012 at 08:49:39PM +0400, Pavel Emelyanov wrote:
> On 09/05/2012 08:22 PM, Cyrill Gorcunov wrote:
> > On Wed, Sep 05, 2012 at 07:59:06PM +0400, Pavel Emelyanov wrote:
> >> On 09/02/2012 08:33 PM, Cyrill Gorcunov wrote:
> >>>
> >>> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> >>> ---
> >>>  files.c |    6 ++++--
> >>>  1 files changed, 4 insertions(+), 2 deletions(-)
> >>>
> >>
> >> Not applied, don't send patches like this please.
> > 
> > Could you please elabprate what's wrong here? Look,
> 
> I personally don't like the
> 
>   if (something) {
> 	one_line_if_body;
>   }
> 
> construction. It's more or less OK when these are added as a part of otherwise
> good patch, but is definitely irritating when being sent as a separate one.
> 
> > lack of brackets is definitely a bad habbit if there
> > are more than a couple of code lines involved.

Pavel, you miss the point ;) The brackes I propose not about
one line, but look what I mean

was

	list_for_each_entry(d, chain, hash)
		if (d->ops->type == type && d->id == id)
			return d;

to be

	list_for_each_entry(d, chain, hash) {
                if (d->ops->type == type && d->id == id)
			return d;
	}

and since I've been touching files.c code, I thought fixing
this dangling "if" clause make sense.

	Cyrill


More information about the CRIU mailing list