From: Christoph Hellwig <hch@lst.de>
To: James.Bottomley@steeleye.com
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH] remove scsi_device proc printing from drivers
Date: Sun, 27 Apr 2003 18:56:28 +0200 [thread overview]
Message-ID: <20030427185628.A30233@lst.de> (raw)
A bunch of drivers contain loops over host->my_devices in their
proc_info method just to printout info we already get from sysfs.
Kill those, the ones that actually add additional information
from their private data need to get sysfs attributes for the fist.
BTW, does someone have opintions on reading of /proc/scsi/scsi?
It's just a duplication of the sysfs tree so it should probably
go away also. OTOH there's a slightly higher chance on userland
actually using this than for the LLDDs..
--- 1.25/drivers/acorn/scsi/acornscsi.c Wed Mar 19 10:19:28 2003
+++ edited/drivers/acorn/scsi/acornscsi.c Sun Apr 27 09:12:47 2003
@@ -2935,37 +2935,6 @@
}
}
- p += sprintf(p, "\nAttached devices:\n");
-
- list_for_each_entry(scd, &instance->my_devices, siblings) {
- int len;
-
- proc_print_scsidevice(scd, p, &len, 0);
- p += len;
-
- p += sprintf(p, "Extensions: ");
-
- if (scd->tagged_supported)
- p += sprintf(p, "TAG %sabled [%d] ",
- scd->tagged_queue ? "en" : "dis", scd->current_tag);
- p += sprintf(p, "\nTransfers: ");
- if (host->device[scd->id].sync_xfer & 15)
- p += sprintf(p, "sync, offset %d, %d ns\n",
- host->device[scd->id].sync_xfer & 15,
- acornscsi_getperiod(host->device[scd->id].sync_xfer));
- else
- p += sprintf(p, "async\n");
-
- pos = p - buffer;
- if (pos + begin < offset) {
- begin += pos;
- p = buffer;
- }
- pos = p - buffer;
- if (pos + begin > offset + length)
- break;
- }
-
pos = p - buffer;
*start = buffer + (offset - begin);
--- 1.22/drivers/acorn/scsi/cumana_2.c Sun Jan 26 14:34:36 2003
+++ edited/drivers/acorn/scsi/cumana_2.c Sun Apr 27 09:12:47 2003
@@ -380,26 +380,6 @@
pos += sprintf(buffer+pos, "\nAttached devices:\n");
- list_for_each_entry(scd, &host->my_devices, siblings) {
- int len;
-
- proc_print_scsidevice(scd, buffer, &len, pos);
- pos += len;
- pos += sprintf(buffer+pos, "Extensions: ");
- if (scd->tagged_supported)
- pos += sprintf(buffer+pos, "TAG %sabled [%d] ",
- scd->tagged_queue ? "en" : "dis",
- scd->current_tag);
- pos += sprintf(buffer+pos, "\n");
-
- if (pos + begin < offset) {
- begin += pos;
- pos = 0;
- }
- if (pos + begin > offset + length)
- break;
- }
-
*start = buffer + (offset - begin);
pos -= offset - begin;
if (pos > length)
--- 1.22/drivers/acorn/scsi/eesox.c Sun Jan 26 14:34:36 2003
+++ edited/drivers/acorn/scsi/eesox.c Sun Apr 27 09:12:47 2003
@@ -452,25 +452,6 @@
pos += fas216_print_stats(&info->info, buffer + pos);
- pos += sprintf(buffer+pos, "\nAttached devices:\n");
-
- list_for_each_entry(scd, &host->my_devices, siblings) {
- int len;
-
- proc_print_scsidevice(scd, buffer, &len, pos);
- pos += len;
- pos += sprintf(buffer+pos, "Extensions: ");
- if (scd->tagged_supported)
- pos += sprintf(buffer+pos, "TAG %sabled [%d] ",
- scd->tagged_queue ? "en" : "dis",
- scd->current_tag);
- pos += sprintf (buffer+pos, "\n");
-
- if (pos + begin < offset) {
- begin += pos;
- pos = 0;
- }
- }
*start = buffer + (offset - begin);
pos -= offset - begin;
if (pos > length)
--- 1.28/drivers/ieee1394/sbp2.c Mon Apr 21 12:30:57 2003
+++ edited/drivers/ieee1394/sbp2.c Sun Apr 27 09:15:05 2003
@@ -3018,7 +3018,6 @@
static int sbp2scsi_proc_info(char *buffer, char **start, off_t offset,
int length, int hostno, int inout)
{
- Scsi_Device *scd;
struct Scsi_Host *host;
struct sbp2scsi_host_info *hi;
char *pos = buffer;
@@ -3044,30 +3043,6 @@
SPRINTF(" max_sectors : %d\n", max_sectors);
SPRINTF(" serialize_io : %s\n", serialize_io ? "yes" : "no");
SPRINTF(" exclusive_login : %s\n", exclusive_login ? "yes" : "no");
-
- SPRINTF("\nAttached devices : %s\n", !list_empty(&host->my_devices) ?
- "" : "none");
-
- list_for_each_entry (scd, &host->my_devices, siblings) {
- int i;
-
- SPRINTF(" [Channel: %02d, Id: %02d, Lun: %02d] ", scd->channel,
- scd->id, scd->lun);
- SPRINTF("%s ", (scd->type < MAX_SCSI_DEVICE_CODE) ?
- scsi_device_types[(short) scd->type] : "Unknown device");
-
- for (i = 0; (i < 8) && (scd->vendor[i] >= 0x20); i++)
- SPRINTF("%c", scd->vendor[i]);
-
- SPRINTF(" ");
-
- for (i = 0; (i < 16) && (scd->model[i] >= 0x20); i++)
- SPRINTF("%c", scd->model[i]);
-
- SPRINTF("\n");
- }
-
- SPRINTF("\n");
/* release the reference count on this host */
scsi_host_put(host);
--- 1.22/drivers/scsi/wd7000.c Sat Apr 26 10:28:29 2003
+++ edited/drivers/scsi/wd7000.c Sun Apr 27 09:12:47 2003
@@ -1450,27 +1450,6 @@
SPRINTF(count ? "\n" : "none\n");
#endif
- /*
- * Display driver information for each device attached to the board.
- */
- SPRINTF("\nAttached devices: %s\n", !list_empty(&host->my_devices) ?
- "" : "none");
-
- list_for_each_entry (scd, &host->my_devices, siblings) {
- SPRINTF(" [Channel: %02d, Id: %02d, Lun: %02d] ", scd->channel, scd->id, scd->lun);
- SPRINTF("%s ", (scd->type < MAX_SCSI_DEVICE_CODE) ? scsi_device_types[(short) scd->type] : "Unknown device");
-
- for (i = 0; (i < 8) && (scd->vendor[i] >= 0x20); i++)
- SPRINTF("%c", scd->vendor[i]);
- SPRINTF(" ");
-
- for (i = 0; (i < 16) && (scd->model[i] >= 0x20); i++)
- SPRINTF("%c", scd->model[i]);
- SPRINTF("\n");
- }
-
- SPRINTF("\n");
-
spin_unlock_irqrestore(host->host_lock, flags);
/*
next reply other threads:[~2003-04-27 16:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-27 16:56 Christoph Hellwig [this message]
2003-04-27 18:10 ` [PATCH] remove scsi_device proc printing from drivers Patrick Mansfield
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=20030427185628.A30233@lst.de \
--to=hch@lst.de \
--cc=James.Bottomley@steeleye.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