public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: "Love, Robert W" <robert.w.love@intel.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"james.smart@emulex.com" <james.smart@emulex.com>,
	"giridhar.malavali@qlogic.com" <giridhar.malavali@qlogic.com>
Subject: Re: [PATCH 3/4] libfcoe: Add fcoe_sysfs
Date: Tue, 13 Mar 2012 19:42:40 -0700	[thread overview]
Message-ID: <20120314024240.GB22955@kroah.com> (raw)
In-Reply-To: <4F5FF22F.2030105@intel.com>

On Wed, Mar 14, 2012 at 01:19:44AM +0000, Love, Robert W wrote:
> On 03/12/2012 10:00 PM, Greg KH wrote:
> > On Mon, Mar 12, 2012 at 04:09:31PM -0700, Robert Love wrote:
> >> +static void fcoe_ctlr_attrs_release(struct device *dev)
> >> +{
> >> +	struct fcoe_ctlr_attrs *ctlr = dev_to_ctlr(dev);
> >> +
> >> +	put_device(ctlr->dev.parent);
> >> +	ctlr->dev.parent = NULL;
> > You should never have to put a reference count on your parent, nor worry
> > about setting this value to NULL.  Just assign the parent when you
> > register the device, no need to increment it.
> 
> Cool, I'll make these changes.
> 
> >> +#define fcoe_ctlr_id(x)				\
> >> +	((x)->id)
> >> +#define fcoe_ctlr_work_q_name(x)		\
> >> +	((x)->work_q_name)
> > <snip>
> >
> > Ick, what are all of these for, please don't do that.
> >
> 
> These are only interesting when you look at the macros used to create 
> the show/store handlers for the attributes.

<snip>

Ah, yes, sorry, that's worthwhile.

> My feeling is that when you looked at the code you just saw unnecessary 
> accessors routines as their usage is not so obvious. I do not intend to 
> be using these accessors anywhere else other than the withing the 
> show/store building routines.

Ok, and they are in the .c file, not .h, right?

> Given my explanation, do you still dislike these?

Nope, they are fine.

> I could move them to the fcoe_sysfs.c so they're not in a header and 
> therefore would look less like accessors that developers should use...

Yes, that will be good.

thanks,

greg k-h

  reply	other threads:[~2012-03-14  2:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-12 23:09 [PATCH 0/4] FCoE Sysfs Robert Love
2012-03-12 23:09 ` [PATCH 1/4] fcoe: Allocate fcoe_ctlr with fcoe_interface, not as a member Robert Love
2012-03-12 23:09 ` [PATCH 2/4] bnx2fc: Allocate fcoe_ctlr with bnx2fc_interface, " Robert Love
2012-03-12 23:09 ` [PATCH 3/4] libfcoe: Add fcoe_sysfs Robert Love
2012-03-13  5:00   ` Greg KH
2012-03-14  1:19     ` Love, Robert W
2012-03-14  2:42       ` Greg KH [this message]
2012-03-12 23:09 ` [PATCH 4/4] fcoe, bnx2fc, libfcoe: SW FCoE and bnx2fc use FCoE Syfs Robert Love
2012-03-13  4:56 ` [PATCH 0/4] FCoE Sysfs Greg KH

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=20120314024240.GB22955@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=giridhar.malavali@qlogic.com \
    --cc=james.smart@emulex.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=robert.w.love@intel.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