Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa2dc372 authored by Joe Carnuccio's avatar Joe Carnuccio Committed by Christoph Hellwig
Browse files

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: default avatarJoe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: default avatarSaurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 299f5e27
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -726,7 +726,7 @@ qla27xx_fwdt_entry_other(struct scsi_qla_host *vha,
}

struct qla27xx_fwdt_entry_call {
	int type;
	uint type;
	int (*call)(
	    struct scsi_qla_host *,
	    struct qla27xx_fwdt_entry *,
@@ -759,15 +759,17 @@ static struct qla27xx_fwdt_entry_call ql27xx_fwdt_entry_call_list[] = {
	{ -1				, qla27xx_fwdt_entry_other }
};

static inline int (*qla27xx_find_entry(int type))
static inline int (*qla27xx_find_entry(uint type))
	(struct scsi_qla_host *, struct qla27xx_fwdt_entry *, void *, ulong *)
{
	struct qla27xx_fwdt_entry_call *list = ql27xx_fwdt_entry_call_list;

	while (list->type != -1 && list->type != type)
	while (list->type < type)
		list++;

	if (list->type == type)
		return list->call;
	return qla27xx_fwdt_entry_other;
}

static inline void *