From: Christoph Hellwig <hch@infradead.org>
To: Martin Hicks <mort@wildopensource.com>
Cc: Christoph Hellwig <hch@infradead.org>, linux-scsi@vger.kernel.org
Subject: Re: Transport Attributes -- attempt#3
Date: Fri, 16 Jan 2004 14:54:57 +0000 [thread overview]
Message-ID: <20040116145457.C24608@infradead.org> (raw)
In-Reply-To: <20040114181241.GK27591@localhost>; from mort@wildopensource.com on Wed, Jan 14, 2004 at 01:12:41PM -0500
> +menu "SCSI Transport Attributes (EXPERIMENTAL)"
> + depends on EXPERIMENTAL && SCSI!=n
Do you really need the experimental flags? Actually this option is
rather bogus anyway - with your patches posted the qlogic drivers won't
compile anymore without those set. So either make it unconditional or
let the drives select it.
> +ifdef CONFIG_SCSI_SPI_ATTRS
> +transport-objs += scsi_transport_spi.o
> +endif
> +ifdef CONFIG_SCSI_FC_ATTRS
> +transport-objs += scsi_transport_fc.o
> +endif
> +
> scsi_mod-y += scsi.o hosts.o scsi_ioctl.o constants.o \
> scsicam.o scsi_error.o scsi_lib.o \
> scsi_scan.o scsi_syms.o scsi_sysfs.o \
> - scsi_devinfo.o
> + scsi_devinfo.o $(transport-objs)
This still looks quite overcomplicated, what about a simple:
scsi_mod-$(CONFIG_SCSI_SPI_ATTRS) += scsi_transport_spi.o
scsi_mod-$(CONFIG_SCSI_FC_ATTRS) += scsi_transport_fc.o
> +#ifdef CONFIG_SCSI_SPI_ATTRS
> +EXPORT_SYMBOL(spi_transport_template);
> +#endif
> +#ifdef CONFIG_SCSI_FC_ATTRS
> +EXPORT_SYMBOL(fc_transport_template);
> +#endif
Should just move to the files declaring it.
> + if (sdev->transport_classdev.class) {
> + attrs = sdev->host->transportt->attrs;
> + for (i = 0; attrs[i]; i++) {
> + error = class_device_create_file(&sdev->transport_classdev,
> + attrs[i]);
> + if (error)
> + scsi_remove_device(sdev);
Missing break here, in fact the cleanup mioght better be after a lable
you goto to.
> +/* A blank transport template that is used in drivers that don't
> + * yet implement Transport Attributes */
> +struct scsi_transport_template blank_transport_template = { NULL };
The zero-initialization is not needed.
> +void scsi_sysfs_cleanup_fc_transport(struct scsi_device *sdev)
> +{
> + kfree(sdev->transport_attr_values);
I think you'll have to do the kfree in the device's ->release, but maybe
I got all that sysfs-foo wrong :)
> + void * transport_attr_values;
void *transport_attr_values;
> + /* Default values for the transport attributes */
> + void *default_attr_values;
Should this really be a void *?
> +extern struct scsi_transport_template blank_transport_template;
Should be in scsi_priv.h as it's not exported, no?
next prev parent reply other threads:[~2004-01-16 14:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-07 18:54 Transport Attributes -- attempt#2 Martin Hicks
2004-01-08 13:17 ` Christoph Hellwig
2004-01-08 14:01 ` Martin Hicks
2004-01-08 14:11 ` James Bottomley
2004-01-14 18:12 ` Transport Attributes -- attempt#3 Martin Hicks
2004-01-14 23:34 ` Andrew Vasquez
2004-01-16 16:40 ` Martin Hicks
2004-01-17 0:23 ` Lincoln Dale
2004-01-14 23:58 ` Patrick Mansfield
2004-01-16 14:54 ` Christoph Hellwig [this message]
2004-01-16 16:54 ` Martin Hicks
2004-01-20 0:07 ` Brian King
2004-01-20 19:49 ` Patrick Mansfield
2004-01-20 20:38 ` Brian King
-- strict thread matches above, loose matches on Subject: below --
2004-01-15 12:52 Martin Peschke3
2004-01-16 16:47 ` Martin Hicks
2004-01-20 12:29 Martin Peschke3
2004-01-20 23:20 Martin Peschke3
2004-01-20 23:45 ` Mike Anderson
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=20040116145457.C24608@infradead.org \
--to=hch@infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mort@wildopensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.