Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Apr 2016 14:25:30 -0500
From:      Pedro Giffuni <pfg@FreeBSD.org>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r297525 - head/sys/compat/linux
Message-ID:  <57016E2A.4060301@FreeBSD.org>
In-Reply-To: <20160404045828.M816@besplex.bde.org>
References:  <201604031440.u33EesB7057019@repo.freebsd.org> <20160404045828.M816@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help


On 03/04/2016 14:11, Bruce Evans wrote:
> On Sun, 3 Apr 2016, Pedro F. Giffuni wrote:
>
>> Author: pfg
>> Log:
>>  Fix indentation oops.
>>
>> Modified:
>>  head/sys/compat/linux/linux_misc.c
>>
>> Modified: head/sys/compat/linux/linux_misc.c
>> ============================================================================== 
>>
>> --- head/sys/compat/linux/linux_misc.c    Sun Apr  3 14:38:26 2016    
>> (r297524)
>> +++ head/sys/compat/linux/linux_misc.c    Sun Apr  3 14:40:54 2016    
>> (r297525)
>> @@ -896,12 +896,12 @@ linux_utimensat(struct thread *td, struc
>>         }
>>         timesp = times;
>>
>> -        if (times[0].tv_nsec == UTIME_OMIT &&
>> -            times[1].tv_nsec == UTIME_OMIT)
>>         /* This breaks POSIX, but is what the Linux kernel does
>>          * _on purpose_ (documented in the man page for utimensat(2)),
>>          * so we must follow that behaviour. */
>> -        return (0);
>> +        if (times[0].tv_nsec == UTIME_OMIT &&
>> +            times[1].tv_nsec == UTIME_OMIT)
>> +            return (0);
>>     }
>>
>>     if (args->pathname != NULL)
>
> The comment is still not written in BSD style.
>
I didn't change the original. Is it worth it to do another commit to add
lines for a beginning and end comment delimiters ?

> The patch shows a bug in svn(?) diff.  The comment was moved, but the
> patch shows movement of the if statement.  The indentation was only
> changed in the return statement.
>
> The comment was also misindented.  Moving it fixes this, but I prefer
> it where it was. 

Precisely .. I moved the "if" so I would not have to indent further the
comment. I find it more readable.

> Comments are often placed before an if statement and
> not properly worded for that placement.  They say that something is
> done unconditionally but that is clearly wrong since the action is
> conditional on the if statement.  Here "this" in the comment used to
> refer to the action of returning, but is ambiguous enough to still make
> sense after the move.  It now refers to the action of doing the check
> and sometimes returning.  The block of code is short enough that the
> ambiguity is easy to resolve.
>
> Bruce
Pedro.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?57016E2A.4060301>