From: James Bottomley <James.Bottomley@steeleye.com>
To: Mike Anderson <andmike@us.ibm.com>
Cc: SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: Round II on sysfs attributes
Date: 23 May 2003 15:43:12 -0400 [thread overview]
Message-ID: <1053718992.1810.29.camel@mulgrave> (raw)
In-Reply-To: <20030523185150.GB1160@beaverton.ibm.com>
On Fri, 2003-05-23 at 14:51, Mike Anderson wrote:
> James Bottomley [James.Bottomley@SteelEye.com] wrote:
> > static void scsi_device_release(struct device *dev)
> > @@ -287,9 +290,9 @@
> > if (error)
> > return error;
> >
> > - for (i = 0; !error && i < ARRAY_SIZE(sdev_attrs); i++)
> > + for (i = 0; !error && sdev->host->hostt->sdev_attrs[i] != NULL; i++)
> > error = device_create_file(&sdev->sdev_driverfs_dev,
> > - sdev_attrs[i]);
> > + sdev->host->hostt->sdev_attrs[i]);
> >
> > if (error)
> > scsi_device_unregister(sdev);
>
> What about this style of bounds check.
> for (i = 0; !error && sdev->host->hostt->sdev_attrs[i]; i++)
It's just personal, but I prefer the explicit check against an object
rather than relying on the promotional to logical value rules. I don't
see that it matters much either way.
> kfree of this memory in driver?
Yes, tricky issue. I'd really rather it be done at template release
time (which we don't have) since we've sort of moved away from template
register/unregister.
I don't like an explicit kfree in the driver since I was trying to hide
the memory manipluations from the LLDs. I suppose we could make the
model per host, rather than per template and use the add/remove host
interfaces, but this property is really a per template property. I'm
open to suggestions.
James
prev parent reply other threads:[~2003-05-23 19:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-23 16:38 Round II on sysfs attributes James Bottomley
2003-05-23 18:30 ` Patrick Mansfield
2003-05-23 19:37 ` James Bottomley
2003-05-23 18:51 ` Mike Anderson
2003-05-23 19:43 ` James Bottomley [this message]
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=1053718992.1810.29.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=andmike@us.ibm.com \
--cc=linux-scsi@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