mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Philip J. Kelleher" <pjk1939@linux.vnet.ibm.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: axboe@kernel.dk,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/8] rsxx: Adding in debugfs entries.
Date: Thu, 30 May 2013 09:54:34 -0500	[thread overview]
Message-ID: <20130530145434.GA3051@oc6784271780.ibm.com> (raw)
In-Reply-To: <CAHp75VdFZmGEPXHQpW3YnvzXHqYsvo2-MhGk-p9itkZu7SnyUg@mail.gmail.com>


I will look into all of the suggestion that you submitted to me.

Thank you for taking the time to review the patches.

Regards,
-Philip Kelleher

On Wed, May 29, 2013 at 09:18:12PM +0300, Andy Shevchenko wrote:
> On Wed, May 29, 2013 at 12:08 AM, Philip J. Kelleher
> <pjk1939@linux.vnet.ibm.com> wrote:
> > From: Philip J Kelleher <pjk1939@linux.vnet.ibm.com>
> >
> > Adding in some debugfs entries to help with debugging and
> > testing code.
> 
> > +++ linux-block/drivers/block/rsxx/core.c       2013-05-02 17:18:22.944239791 -0500
> > @@ -52,6 +54,191 @@ MODULE_PARM_DESC(force_legacy, "Force th
> >  static DEFINE_IDA(rsxx_disk_ida);
> >  static DEFINE_SPINLOCK(rsxx_ida_lock);
> >
> > +/* --------------------Debugfs Setup ------------------- */
> > +
> > +static struct dentry *rsxx_debugfs_root;
> 
> I didn't get if you use only one debugfs_root per instance? How do you
> distinguish two or more cards then?
> 
> > +static void rsxx_debugfs_dev_new(struct rsxx_cardinfo *card)
> > +{
> > +       if (!rsxx_debugfs_root)
> > +               return;
> 
> It seems you always call this after debugfs_init(). So, remove this
> check (keep in mind you have to check debugfs_init() return code - see
> below).
> 
> > +static void rsxx_debugfs_dev_remove(struct rsxx_cardinfo *card)
> > +{
> > +}
> 
> Useless function. See below.
> 
> > +static void rsxx_debugfs_init(void)
> > +{
> > +       rsxx_debugfs_root = debugfs_create_dir(DRIVER_NAME, NULL);
> 
> Same comment for DRIVER_NAME as for global variable debugfs_root above.
> 
> > +       if (!rsxx_debugfs_root)
> > +               return;
> 
> It should be checked for NULL and for ERR_PTR. Return error instead of void.
> 
> > +static void rsxx_debugfs_destroy(void)
> > +{
> > +       if (!rsxx_debugfs_root)
> > +               return;
> 
> Use debugfs_remove_recursive().
> It's also NULL-proof.
> 
> > +       debugfs_remove(rsxx_debugfs_root);
> > +       rsxx_debugfs_root = NULL;
> 
> If you will use this on card based, you  probably have to move this
> from global space to card space.
> 
> > +++ linux-block/drivers/block/rsxx/rsxx_priv.h  2013-05-02 17:17:25.154498245 -0500
> > @@ -181,6 +181,11 @@ struct rsxx_cardinfo {
> >
> >         int                     n_targets;
> >         struct rsxx_dma_ctrl    *ctrl;
> > +
> > +       /* Debugfs Variables */
> > +       struct dentry           *debugfs_dir;
> > +       struct dentry           *debugfs_stats;
> > +       struct dentry           *debugfs_pci_regs;
> 
> No need to keep those pointers since you may use debugfs_remove_recursive().
> 
> --
> With Best Regards,
> Andy Shevchenko
> 


  reply	other threads:[~2013-05-30 14:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-28 21:08 Philip J. Kelleher
2013-05-29 18:18 ` Andy Shevchenko
2013-05-30 14:54   ` Philip J. Kelleher [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-05-02  0:23 Philip J. Kelleher
2013-05-02  8:03 ` Jens Axboe
2013-05-02 14:04   ` Philip J. Kelleher
2013-05-02 14:07     ` Jens Axboe
2013-05-02 14:35       ` Philip J. Kelleher

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=20130530145434.GA3051@oc6784271780.ibm.com \
    --to=pjk1939@linux.vnet.ibm.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®