public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Kurt Garloff <garloff@suse.de>
To: Christoph Hellwig <hch@infradead.org>,
	James Bottomley <James.Bottomley@steeleye.com>,
	Linux SCSI list <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] sysfs host name support
Date: Mon, 1 Mar 2004 00:37:09 +0100	[thread overview]
Message-ID: <20040229233709.GD13934@tpkurt.garloff.de> (raw)
In-Reply-To: <20040210003332.GF4538@tpkurt.garloff.de>


[-- Attachment #1.1: Type: text/plain, Size: 629 bytes --]

On Tue, Feb 10, 2004 at 01:33:32AM +0100, Kurt Garloff wrote:
> OK, let's export the proc_name then. It's some name that can be used
> to identify the driver, works for code both compiled statically or
> as module, is reasonably short and very often resembles the module
> name.
> 
> For the module_name, let's wait for a generic sysfs solution. 
> 
> Please merge the attached patch.

Any consensus about this one?

I'd certainly like to see it merged.

Regards,
-- 
Kurt Garloff  <garloff@suse.de>                            Cologne, DE 
SUSE LINUX AG, Nuernberg, DE                          SUSE Labs (Head)

[-- Attachment #1.2: scsi_sysfs-procname-2.diff --]
[-- Type: text/plain, Size: 1879 bytes --]

--- linux/drivers/scsi/scsi_sysfs.c.orig	2004-01-09 07:59:10.000000000 +0100
+++ linux/drivers/scsi/scsi_sysfs.c	2004-02-10 01:29:36.903202660 +0100
@@ -58,21 +58,24 @@
  * shost_show_function: macro to create an attr function that can be used to
  * show a non-bit field.
  */
-#define shost_show_function(field, format_string)			\
+#define shost_show_function(name, field, format_string)			\
 static ssize_t								\
-show_##field (struct class_device *class_dev, char *buf)		\
+show_##name (struct class_device *class_dev, char *buf)			\
 {									\
 	struct Scsi_Host *shost = class_to_shost(class_dev);		\
-	return snprintf (buf, 20, format_string, shost->field);	\
+	return snprintf (buf, 20, format_string, shost->field);		\
 }
 
 /*
  * shost_rd_attr: macro to create a function and attribute variable for a
  * read only field.
  */
-#define shost_rd_attr(field, format_string)				\
-	shost_show_function(field, format_string)			\
-static CLASS_DEVICE_ATTR(field, S_IRUGO, show_##field, NULL)
+#define shost_rd_attr2(name, field, format_string)			\
+	shost_show_function(name, field, format_string)			\
+static CLASS_DEVICE_ATTR(name, S_IRUGO, show_##name, NULL)
+
+#define shost_rd_attr(field, format_string) \
+shost_rd_attr2(field, field, format_string)
 
 /*
  * Create the actual show/store functions and data structures.
@@ -96,6 +99,7 @@
 shost_rd_attr(cmd_per_lun, "%hd\n");
 shost_rd_attr(sg_tablesize, "%hu\n");
 shost_rd_attr(unchecked_isa_dma, "%d\n");
+shost_rd_attr2(proc_name, hostt->proc_name, "%s\n");
 
 static struct class_device_attribute *scsi_sysfs_shost_attrs[] = {
 	&class_device_attr_unique_id,
@@ -103,6 +107,7 @@
 	&class_device_attr_cmd_per_lun,
 	&class_device_attr_sg_tablesize,
 	&class_device_attr_unchecked_isa_dma,
+	&class_device_attr_proc_name,
 	&class_device_attr_scan,
 	NULL
 };

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2004-02-29 23:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-09 15:50 [PATCH] sysfs host name support Kurt Garloff
2004-02-09 16:05 ` Christoph Hellwig
2004-02-09 16:09   ` James Bottomley
2004-02-09 16:20     ` Christoph Hellwig
2004-02-10  0:33       ` Kurt Garloff
2004-02-29 23:37         ` Kurt Garloff [this message]
2004-02-09 16:16   ` Kurt Garloff

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=20040229233709.GD13934@tpkurt.garloff.de \
    --to=garloff@suse.de \
    --cc=James.Bottomley@steeleye.com \
    --cc=hch@infradead.org \
    --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