mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hin-Tak Leung <htl10@users.sourceforge.net>
To: Vyacheslav Dubeyko <slava@dubeyko.com>, Joe Perches <joe@perches.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] hfs/hfsplus: Convert dprint to hfs_dbg
Date: Mon, 15 Apr 2013 01:53:01 +0100 (BST)	[thread overview]
Message-ID: <1365987181.4850.YahooMailClassic@web172306.mail.ir2.yahoo.com> (raw)
In-Reply-To: <60b028ebc7235d8ba4ff1a2e936f879e0d806a9b.1365438494.git.joe@perches.com>

--- On Mon, 8/4/13, Joe Perches <joe@perches.com> wrote:

> Use a more current logging style.
> 
> Rename macro and uses.
> Add do {} while (0) to macro.
> Add DBG_ to macro.
> Add and use hfs_dbg_cont variant where appropriate.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

<a lot of dprint to hfs_dbg changes snipped>

> +++ b/fs/hfs/hfs_fs.h
> @@ -34,8 +34,18 @@
>  //#define DBG_MASK   
> (DBG_CAT_MOD|DBG_BNODE_REFS|DBG_INODE|DBG_EXTENT)
>  #define DBG_MASK    (0)
>  
> -#define dprint(flg, fmt, args...) \
> -    if (flg & DBG_MASK) printk(fmt , ##
> args)
> +#define hfs_dbg(flg, fmt, ...)   
>             \
> +do {       
>            
>         \
> +    if (DBG_##flg &
> DBG_MASK)       
>     \
> +        printk(KERN_DEBUG
> fmt, ##__VA_ARGS__);    \
> +} while (0)
> +
> +#define hfs_dbg_cont(flg, fmt, ...)   
>         \
> +do {       
>            
>         \
> +    if (DBG_##flg &
> DBG_MASK)       
>     \
> +        printk(KERN_CONT fmt,
> ##__VA_ARGS__);    \
> +} while (0)
> +
>  
>  /*
>   * struct hfs_inode_info

<a lot of dprint to hfs_dbg change snipped>

This set of change seems to be somewhat zealous - it doesn't offer any benefits other than possibly satisfying somebody's idea of code-purity.

FWIW, I have been sitting on a patch which changes this part of the code to dynamic debugging, and it is much simplier. Just:

=============================
diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h
index e298b83..55d211d 100644
--- a/fs/hfsplus/hfsplus_fs.h
+++ b/fs/hfsplus/hfsplus_fs.h
@@ -45,8 +25,7 @@
 #define HFSPLUS_JOURNAL_SWAP           1
 
 #define dprint(flg, fmt, args...) \
-       if (flg & DBG_MASK) \
-               printk(fmt , ## args)
+               pr_debug(fmt , ## args)
 
 /* Runtime config options */
 #define HFSPLUS_DEF_CR_TYPE    0x3F3F3F3F  /* '????' */
=========================

(and you can then remove all the DBG_* defines before that, since they then don't have any effect any more).

The benefit of this alternative is that it does not break any out-of-tree patches, while make it easier to debug say patches... and I am still sitting on a rather substantial set of the journal change, plus all the other issues that come out of it, like the folder count patch for case-sensitive file systems.

I think one needs to think very carefully about make bulk changes like this, which serves no real purpose other than satisfying somebody's idea of code purity.

The problem with such bulk "stylistic" changes, is that it forces people who are working on real functionalities and bug fixes to rebase their work, and spend time on doing so, and also at the risk introducing new bugs while rebasing. I know I am writing on a somewhat selfish purpose: if I need to rebase my work due to other's bug fixes or enhancement, etc, then fair enough, but I'd prefer not to rebase for the purpose of other's preference of, and attempts at re-arranging the style of the debug statements, when the debugging output means little to them.






  parent reply	other threads:[~2013-04-15  0:59 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-29 21:44 [PATCH] hfs: add error checking for hfs_find_init() Alexey Khoroshilov
2013-03-30 11:35 ` Vyacheslav Dubeyko
2013-03-30 14:01   ` Hin-Tak Leung
2013-04-06 21:13   ` Alexey Khoroshilov
2013-04-07  9:31     ` Vyacheslav Dubeyko
2013-04-07 21:21       ` [PATCH 1/2] hfsplus: add error propagation to __hfsplus_ext_write_extent() Alexey Khoroshilov
2013-04-07 21:21         ` [PATCH 2/2] hfsplus: add printk to log allocation failure in hfs_find_init() Alexey Khoroshilov
2013-04-07 22:00           ` Joe Perches
2013-04-08  6:08             ` Vyacheslav Dubeyko
2013-04-08 16:37               ` [PATCH 0/2] hfs/hfsplus: Modernize logging styles Joe Perches
2013-04-08 16:37                 ` [PATCH 1/2] hfs/hfsplus: Convert dprint to hfs_dbg Joe Perches
2013-04-09  7:08                   ` Vyacheslav Dubeyko
2013-04-15  0:53                   ` Hin-Tak Leung [this message]
2013-04-15  1:51                     ` Joe Perches
2013-04-15  1:56                       ` Hin-Tak Leung
2013-04-15  2:06                         ` Joe Perches
2013-04-15  3:46                           ` Hin-Tak Leung
2013-04-15  4:00                             ` Joe Perches
2013-04-15  4:22                               ` Hin-Tak Leung
2013-04-15  4:38                                 ` Joe Perches
2013-04-08 16:37                 ` [PATCH 2/2] hfs/hfsplus: Convert printks to pr_<level> Joe Perches
2013-04-09  7:08                   ` Vyacheslav Dubeyko
2013-04-09  7:08                 ` [PATCH 0/2] hfs/hfsplus: Modernize logging styles Vyacheslav Dubeyko
2013-04-09 10:39                   ` Joe Perches
2013-04-09 11:06                     ` Vyacheslav Dubeyko
2013-04-08  5:55         ` [PATCH 1/2] hfsplus: add error propagation to __hfsplus_ext_write_extent() Vyacheslav Dubeyko
2013-04-09 18:14           ` [PATCH 1/2] hfs: add error checking for hfs_find_init() Alexey Khoroshilov
2013-04-09 18:14             ` [PATCH 2/2] hfsplus: add error propagation to __hfsplus_ext_write_extent() Alexey Khoroshilov
2013-04-10  6:40               ` Vyacheslav Dubeyko
2013-04-10  6:40             ` [PATCH 1/2] hfs: add error checking for hfs_find_init() Vyacheslav Dubeyko

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=1365987181.4850.YahooMailClassic@web172306.mail.ir2.yahoo.com \
    --to=htl10@users.sourceforge.net \
    --cc=joe@perches.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=slava@dubeyko.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®