aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Carnuccio <joe.carnuccio@qlogic.com>2014-09-25 05:16:33 -0400
committerChristoph Hellwig <hch@lst.de>2014-09-25 08:25:01 -0400
commitaa2dc3727a934e63a74e6dd5f017d263d9baa70a (patch)
treee4138ffe708ef11b8c988cb16288545ec0628bb9
parent299f5e27ac5fac42f5be38a1cdf004b4e8217cbf (diff)
qla2xxx: ISP27xx optimize fwdump entry table lookup.
Since the entry call array is sorted in order of entry type opcode, the search can be terminated as soon as the search key is exceeded. Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/scsi/qla2xxx/qla_tmpl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/scsi/qla2xxx/qla_tmpl.c b/drivers/scsi/qla2xxx/qla_tmpl.c
index 252de5d7bff6..29271cc7659a 100644
--- a/drivers/scsi/qla2xxx/qla_tmpl.c
+++ b/drivers/scsi/qla2xxx/qla_tmpl.c
@@ -726,7 +726,7 @@ qla27xx_fwdt_entry_other(struct scsi_qla_host *vha,
726} 726}
727 727
728struct qla27xx_fwdt_entry_call { 728struct qla27xx_fwdt_entry_call {
729 int type; 729 uint type;
730 int (*call)( 730 int (*call)(
731 struct scsi_qla_host *, 731 struct scsi_qla_host *,
732 struct qla27xx_fwdt_entry *, 732 struct qla27xx_fwdt_entry *,
@@ -759,15 +759,17 @@ static struct qla27xx_fwdt_entry_call ql27xx_fwdt_entry_call_list[] = {
759 { -1 , qla27xx_fwdt_entry_other } 759 { -1 , qla27xx_fwdt_entry_other }
760}; 760};
761 761
762static inline int (*qla27xx_find_entry(int type)) 762static inline int (*qla27xx_find_entry(uint type))
763 (struct scsi_qla_host *, struct qla27xx_fwdt_entry *, void *, ulong *) 763 (struct scsi_qla_host *, struct qla27xx_fwdt_entry *, void *, ulong *)
764{ 764{
765 struct qla27xx_fwdt_entry_call *list = ql27xx_fwdt_entry_call_list; 765 struct qla27xx_fwdt_entry_call *list = ql27xx_fwdt_entry_call_list;
766 766
767 while (list->type != -1 && list->type != type) 767 while (list->type < type)
768 list++; 768 list++;
769 769
770 return list->call; 770 if (list->type == type)
771 return list->call;
772 return qla27xx_fwdt_entry_other;
771} 773}
772 774
773static inline void * 775static inline void *