linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Behrens <sbehrens@giantdisaster.de>
To: Goffredo Baroncelli <kreijack@gmail.com>
Cc: linux-btrfs@vger.kernel.org, Goffredo Baroncelli <kreijack@inwind.it>
Subject: Re: [PATCH] Add btrfs-show-super
Date: Fri, 02 Nov 2012 21:44:38 +0100	[thread overview]
Message-ID: <509430B6.7040901@giantdisaster.de> (raw)
In-Reply-To: <1351865850-21688-2-git-send-email-kreijack@inwind.it>

On 11/02/2012 15:17, Goffredo Baroncelli wrote:
> Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
> ---
>   Makefile           |    5 +-
>   btrfs-show-super.c |  284 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>   2 files changed, 288 insertions(+), 1 deletion(-)
>   create mode 100644 btrfs-show-super.c
>

Good enhancement! Thank you! I like and recommend this enhanced version 
of the btrfs-show-super tool.

Goffredo, you are doing a very good and valuable job on improving the 
Btrfs tools. And you are one of the main contributors to btrfs-progs. 
Especially because of the huge amount of code that you are contributing, 
I would like to ask you to make your C source code formatting rules 
consistent with the rest of the Btrfs source code. In particular, I am 
talking about the way you use spaces. It is always the first thing that 
I notice, and quite often I just stop reading patches after noticing 
that the C source formatting is violating the rules. Just imagine that 
the Linux kernel would be written in hundreds of different C formatting 
styles. What a pain for the eyes this would be. Patches would contain 
99% formatting changes. Source code would be almost unreadable. 
Therefore strict rules have been established how to format C code 
(including how to use spaces in the C code). The same rules should be 
applied to the btrfs-progs code. Please, please, please reconsider the 
way you place spaces when you submit Btrfs patches! See below. Don't 
feel offended, just place the spaces correctly, please! Your work is 
good, just the way you place spaces is not good :)


[...]
> +	for ( i = optind ; i < argc ; i++ ) {
+	for (i = optind; i < argc ; i++) {

[...]
> +		if (all){
> +			int idx;
> +			for (idx = 0 ; idx < BTRFS_SUPER_MIRROR_MAX ; idx++) {
+		if (all) {
+			int idx;
+			for (idx = 0; idx < BTRFS_SUPER_MIRROR_MAX; idx++) {

[...]
> +	if (ret != BTRFS_SUPER_INFO_SIZE ) {
> +		int e = errno;
> +
> +		/* check if the disk if too short for further superblock */
> +		if( ret == 0 && e == 0 )
+	if (ret != BTRFS_SUPER_INFO_SIZE) {
+		int e = errno;
+
+		/* check if the disk if too short for further superblock */
+		if (ret == 0 && e == 0)

[...]
> +	for (i = 0, p = sb->csum ; i < btrfs_super_csum_size(sb) ; i++ )
+	for (i = 0, p = sb->csum; i < btrfs_super_csum_size(sb); i++)

[...]
> +	for (i = 0 ; i < 8 ; i++ )
+	for (i = 0; i < 8; i++)

[...]
> +	for (i = 0 ; i < BTRFS_LABEL_SIZE && s[i] ; i++)
+	for (i = 0; i < BTRFS_LABEL_SIZE && s[i]; i++)


The Linux kernel sources contain docs and tools for the formatting issue:
- Documentation/CodingStyle describes the C source code formatting rules 
that are expected in the Linux world.
- scripts/checkpatch.pl can detect lots of violations to these 
formatting rules.


  reply	other threads:[~2012-11-02 20:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-02 14:17 [PATCH][BTRFS-PROGS][V1] btrfs-show-super: a tool to dump superblock Goffredo Baroncelli
2012-11-02 14:17 ` [PATCH] Add btrfs-show-super Goffredo Baroncelli
2012-11-02 20:44   ` Stefan Behrens [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-11-02 21:46 [PATCH][BTRFS-PROGS][V2] btrfs-show-super: a tool to dump superblock Goffredo Baroncelli
2012-11-02 21:46 ` [PATCH] Add btrfs-show-super Goffredo Baroncelli
2012-11-02 22:38   ` Stefan Behrens
2012-11-03 21:37   ` Alex Lyakas

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=509430B6.7040901@giantdisaster.de \
    --to=sbehrens@giantdisaster.de \
    --cc=kreijack@gmail.com \
    --cc=kreijack@inwind.it \
    --cc=linux-btrfs@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).