avoid list seatch in fusion ->proc_info
Subsystems (2)
PATCH 1/1 avoid list seatch in fusion ->proc_info
in 2.4 there only was a host no argument to ->proc_info so drivers had to search on their own. 2.5 has a proper struct Scsi_Host so we better use it.
drivers/message/fusion/mptscsih.c +2 -15
@@ -2188,22 +2188,9 @@int mptscsih_proc_info (struct Scsi_Host *host,char *buffer,char **start,off_t offset,int length,int func) { -MPT_ADAPTER *ioc; -MPT_SCSI_HOST *hd =NULL ; +MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; +MPT_ADAPTER *ioc = hd->ioc;int size =0 ; - -dprintk (("Called mptscsih_proc_info: hostno=%d, func=%d\n" , host->host_no, func)); -dprintk (("buffer %p, start=%p (%p) offset=%ld length = %d\n" , - buffer, start, *start, offset, length)); - -for (ioc =mpt_adapter_find_first (); ioc !=NULL ; ioc =mpt_adapter_find_next (ioc)) { -if ((ioc->sh) && (ioc->sh == host)) { - hd = (MPT_SCSI_HOST *)ioc->sh->hostdata; -break ; - } - } -if ((ioc ==NULL ) || (ioc->sh ==NULL ) || (hd ==NULL )) -return 0 ;if (func) { size =mptscsih_user_command (ioc, buffer, length);