All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
To: Adrian Bunk <trivial@kernel.org>
Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2 8/9] bfs: remove multiple assignments
Date: Sun, 27 Jan 2008 17:39:19 +0300	[thread overview]
Message-ID: <479C9797.6090300@gmail.com> (raw)
In-Reply-To: <20080127140814.GA1916@does.not.exist>

Adrian Bunk пишет:
> On Sat, Jan 26, 2008 at 06:35:41PM +0000, Tigran Aivazian wrote:
>> On Sat, 26 Jan 2008, Dmitri Vorobiev wrote:
>>> -	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC;
>>> +	inode->i_mtime = CURRENT_TIME_SEC;
>>> +	inode->i_atime = CURRENT_TIME_SEC;
>>> +	inode->i_ctime = CURRENT_TIME_SEC;
>> multiple assignments like "x = y = z = value;" can potentially (depending 
>> on the compiler and arch) be faster than "x = value; y = value; z=value;"
> 
> Only depending on the compiler, and recent gcc versions are quite good 
> at optimizing code.
> 
>> I am surprized that this script complains about them as it is a perfectly 
>> valid thing to do in C.
> 
> Checkpatch warns about the something already documented in 
> Documentation/CodingStyle:
> 
> <--  snip  -->
> 
> Don't put multiple assignments on a single line either.  Kernel coding style
> is super simple.  Avoid tricky expressions.
> 
> <--  snip  -->
> 
> Nobody claims it wasn't perfectly valid C code, the point is that 
> multiple assignments on a single line are harder to read.

Thanks for your explanation. So, it was just a matter of readability,
not language lawyering. In fact, this is how I interpreted that complaint
from the checkpatch.pl script.

Dmitri

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2008-01-27 14:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-25 21:20 [PATCH v2 0/9] bfs: assorted cleanups Dmitri Vorobiev
2008-01-25 21:20 ` [PATCH v2 1/9] bfs: remove a useless variable Dmitri Vorobiev
2008-01-25 21:20 ` [PATCH v2 2/9] bfs: coding style cleanup in fs/bfs/inode.c Dmitri Vorobiev
2008-01-25 21:20 ` [PATCH v2 3/9] bfs: coding style cleanup in fs/bfs/bfs.h Dmitri Vorobiev
2008-01-25 21:20 ` [PATCH v2 4/9] bfs: coding style cleanup in fs/bfs/dir.c Dmitri Vorobiev
2008-01-25 21:20 ` [PATCH v2 5/9] bfs: move function prototype to the proper header file Dmitri Vorobiev
2008-01-25 21:20 ` [PATCH v2 6/9] bfs: coding style cleanup in fs/bfs/file.c Dmitri Vorobiev
2008-01-25 21:20 ` [PATCH v2 7/9] bfs: coding style cleanup in include/linux/bfs_fs.h Dmitri Vorobiev
2008-01-25 21:20 ` [PATCH v2 8/9] bfs: remove multiple assignments Dmitri Vorobiev
2008-01-26 18:35   ` Tigran Aivazian
2008-01-26 21:32     ` Dmitri Vorobiev
2008-01-26 23:48     ` Dmitri Vorobiev
2008-01-28  7:02       ` Joel Schopp
2008-01-30 13:06         ` Al Viro
2008-01-30 13:36           ` Dmitri Vorobiev
2008-01-27 14:08     ` Adrian Bunk
2008-01-27 14:39       ` Dmitri Vorobiev [this message]
2008-01-25 21:20 ` [PATCH v2 9/9] bfs: use the proper header file for inclusion Dmitri Vorobiev

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=479C9797.6090300@gmail.com \
    --to=dmitri.vorobiev@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tigran@aivazian.fsnet.co.uk \
    --cc=trivial@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.