[Open-FCoE] [PATCH 1/4] Remove fc_get_host_port_id() from fc_attr.c

Steve Ma steve.ma at intel.com
Tue Sep 23 00:40:43 UTC 2008


Instead of calling the function fc_get_host_port_id() in fc_attr.c,
add a line "fc_host_port_id(lp->host) = fid" in the routine
fc_lport_set_fid(). Thus the routine fc_get_host_port_id() is no
longer needed.

Signed-off-by: Steve Ma <steve.ma at intel.com>
---

 drivers/scsi/fcoe/fcoeinit.c  |    1 -
 drivers/scsi/libfc/fc_attr.c  |    8 --------
 drivers/scsi/libfc/fc_lport.c |    5 ++---
 include/scsi/libfc/libfc.h    |    7 +++----
 4 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoeinit.c b/drivers/scsi/fcoe/fcoeinit.c
index 419ced9..7e81661 100644
--- a/drivers/scsi/fcoe/fcoeinit.c
+++ b/drivers/scsi/fcoe/fcoeinit.c
@@ -66,7 +66,6 @@ struct fc_function_template fcoe_transport_function = {
 	.show_host_active_fc4s = 1,
 	.show_host_maxframe_size = 1,
 
-	.get_host_port_id = fc_get_host_port_id,
 	.show_host_port_id = 1,
 	.show_host_supported_speeds = 1,
 	.get_host_speed = fc_get_host_speed,
diff --git a/drivers/scsi/libfc/fc_attr.c b/drivers/scsi/libfc/fc_attr.c
index 0a99f83..bdc06e1 100644
--- a/drivers/scsi/libfc/fc_attr.c
+++ b/drivers/scsi/libfc/fc_attr.c
@@ -28,14 +28,6 @@ MODULE_AUTHOR("Open-FCoE.org");
 MODULE_DESCRIPTION("libfc");
 MODULE_LICENSE("GPL");
 
-void fc_get_host_port_id(struct Scsi_Host *shost)
-{
-	struct fc_lport *lp = shost_priv(shost);
-
-	fc_host_port_id(shost) = fc_lport_get_fid(lp);
-}
-EXPORT_SYMBOL(fc_get_host_port_id);
-
 void fc_get_host_port_type(struct Scsi_Host *shost)
 {
 	fc_host_port_type(shost) = FC_PORTTYPE_NPORT;
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index fe4f6cf..f666ceb 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -118,12 +118,10 @@ void fc_get_host_port_state(struct Scsi_Host *shost)
 }
 EXPORT_SYMBOL(fc_get_host_port_state);
 
-/*
- * Routines to support struct fc_function_template
- */
 void fc_get_host_speed(struct Scsi_Host *shost)
 {
 	struct fc_lport *lport = shost_priv(shost);
+
 	fc_host_speed(shost) = lport->link_speed;
 }
 EXPORT_SYMBOL(fc_get_host_speed);
@@ -175,6 +173,7 @@ static void fc_lport_set_fid(struct fc_lport *lp, u32 fid)
 		FC_DBG("changing local port fid from %x to %x\n",
 		       lp->fid, fid);
 	lp->fid = fid;
+	fc_host_port_id(lp->host) = fid;
 	lp->tt.rport_reset_list(lp);
 }
 
diff --git a/include/scsi/libfc/libfc.h b/include/scsi/libfc/libfc.h
index 771640d..6c19a02 100644
--- a/include/scsi/libfc/libfc.h
+++ b/include/scsi/libfc/libfc.h
@@ -745,10 +745,9 @@ void fc_seq_get_xids(struct fc_seq *sp, u16 *oxid, u16 *rxid);
  */
 void fc_seq_set_rec_data(struct fc_seq *sp, u32 rec_data);
 
-/**
- * fc_functions_template
- *****************************/
-void fc_get_host_port_id(struct Scsi_Host *shost);
+/*
+ * Functions for fc_functions_template
+ */
 void fc_get_host_speed(struct Scsi_Host *shost);
 void fc_get_host_port_type(struct Scsi_Host *shost);
 void fc_get_host_port_state(struct Scsi_Host *shost);




More information about the devel mailing list