Commit e07f4449 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by James Bottomley

[PATCH] remove proc_print_scsidevice abuse from drivers

proc_print_scsidevice is used for the scsi device listing in
/proc/scsi/scsi, but in addition two drivers (advansys and eata_pio)
are using it to duplicate the same information in their proc_info
method.  Remove that output and make the function static to
scsi_proc.c.  Also remove proc_scsi from the public headers - it
should really be private to the scsi midlayer but I don't think
we can shange the sg procfs name anymore.
parent e72fc23c
...@@ -4394,32 +4394,6 @@ advansys_proc_info(char *buffer, char **start, off_t offset, int length, ...@@ -4394,32 +4394,6 @@ advansys_proc_info(char *buffer, char **start, off_t offset, int length,
advoffset += cplen; advoffset += cplen;
curbuf += cnt; curbuf += cnt;
/*
* Display target driver information for each device attached
* to the board.
*/
list_for_each_entry (scd, &shp->my_devices, siblings)
{
if (scd->host == shp) {
cp = boardp->prtbuf;
/*
* Note: If proc_print_scsidevice() writes more than
* ASC_PRTBUF_SIZE bytes, it will overrun 'prtbuf'.
*/
proc_print_scsidevice(scd, cp, &cplen, 0);
ASC_ASSERT(cplen < ASC_PRTBUF_SIZE);
cnt = asc_proc_copy(advoffset, offset, curbuf, leftlen, cp, cplen);
totcnt += cnt;
leftlen -= cnt;
if (leftlen == 0) {
ASC_DBG1(1, "advansys_proc_info: totcnt %d\n", totcnt);
return totcnt;
}
advoffset += cplen;
curbuf += cnt;
}
}
/* /*
* Display EEPROM configuration for the board. * Display EEPROM configuration for the board.
*/ */
......
...@@ -155,24 +155,6 @@ static int eata_pio_proc_info(char *buffer, char **start, off_t offset, ...@@ -155,24 +155,6 @@ static int eata_pio_proc_info(char *buffer, char **start, off_t offset,
if (pos > offset + length) if (pos > offset + length)
goto stop_output; goto stop_output;
size = sprintf(buffer+len,"Attached devices: %s\n",
(!list_empty(&shost->my_devices))?"":"none");
len += size;
pos = begin + len;
list_for_each_entry(sdev, &shost->my_devices, siblings) {
proc_print_scsidevice(sdev, buffer, &size, len);
len += size;
pos = begin + len;
if (pos < offset) {
len = 0;
begin = pos;
}
if (pos > offset + length)
goto stop_output;
}
stop_output: stop_output:
DBG(DBG_PROC, printk("2pos: %ld offset: %ld len: %d\n", pos, offset, len)); DBG(DBG_PROC, printk("2pos: %ld offset: %ld len: %d\n", pos, offset, len));
*start=buffer+(offset-begin); /* Start of wanted data */ *start=buffer+(offset-begin); /* Start of wanted data */
......
...@@ -455,13 +455,9 @@ extern void scsi_exit_procfs(void); ...@@ -455,13 +455,9 @@ extern void scsi_exit_procfs(void);
extern void scsi_proc_host_add(struct Scsi_Host *); extern void scsi_proc_host_add(struct Scsi_Host *);
extern void scsi_proc_host_rm(struct Scsi_Host *); extern void scsi_proc_host_rm(struct Scsi_Host *);
extern struct proc_dir_entry *proc_scsi;
extern void proc_print_scsidevice(Scsi_Device * sdev, char *buffer, int *size, int len);
#else #else
static inline int scsi_init_procfs(void) { return 0; } static inline int scsi_init_procfs(void) { return 0; }
static inline void scsi_exit_procfs(void) { ; } static inline void scsi_exit_procfs(void) { ; }
static inline void proc_print_scsidevice(Scsi_Device * sdev, char *buffer, int *size, int len) { ; }
static inline void scsi_proc_host_add(struct Scsi_Host *); static inline void scsi_proc_host_add(struct Scsi_Host *);
static inline void scsi_proc_host_rm(struct Scsi_Host *); static inline void scsi_proc_host_rm(struct Scsi_Host *);
......
...@@ -149,8 +149,8 @@ void scsi_proc_host_rm(struct Scsi_Host *shost) ...@@ -149,8 +149,8 @@ void scsi_proc_host_rm(struct Scsi_Host *shost)
remove_proc_entry(shost->hostt->proc_name, proc_scsi); remove_proc_entry(shost->hostt->proc_name, proc_scsi);
} }
/* XXX: this shouldn't really be exposed to drivers. */ static void proc_print_scsidevice(struct scsi_device* sdev, char *buffer,
void proc_print_scsidevice(Scsi_Device * sdev, char *buffer, int *size, int len) int *size, int len)
{ {
int x, y = *size; int x, y = *size;
...@@ -195,7 +195,6 @@ void proc_print_scsidevice(Scsi_Device * sdev, char *buffer, int *size, int len) ...@@ -195,7 +195,6 @@ void proc_print_scsidevice(Scsi_Device * sdev, char *buffer, int *size, int len)
*size = y; *size = y;
return; return;
} }
EXPORT_SYMBOL(proc_print_scsidevice);
/* /*
* proc_scsi_dev_info_read: dump the scsi_dev_info_list via * proc_scsi_dev_info_read: dump the scsi_dev_info_list via
......
...@@ -2772,6 +2772,10 @@ static struct sg_proc_leaf sg_proc_leaf_arr[] = { ...@@ -2772,6 +2772,10 @@ static struct sg_proc_leaf sg_proc_leaf_arr[] = {
size : begin + len - offset; \ size : begin + len - offset; \
} while(0) } while(0)
/* this should _really_ be private to the scsi midlayer. But
/proc/scsi/sg is an established name, so.. */
extern struct proc_dir_entry *proc_scsi;
static int static int
sg_proc_init() sg_proc_init()
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment