Commit fcabb09e authored by Johannes Thumshirn's avatar Johannes Thumshirn Committed by Martin K. Petersen

scsi: libfc: directly call ELS request handlers

Directly call ELS request handler functions in fc_lport_recv_els_req
instead of saving the pointer to the handler's receive function and then
later dereferencing this pointer.

This makes the code a bit more obvious.
Signed-off-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: default avatarChad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 97d27b0d
...@@ -887,8 +887,6 @@ static void fc_lport_recv_flogi_req(struct fc_lport *lport, ...@@ -887,8 +887,6 @@ static void fc_lport_recv_flogi_req(struct fc_lport *lport,
static void fc_lport_recv_els_req(struct fc_lport *lport, static void fc_lport_recv_els_req(struct fc_lport *lport,
struct fc_frame *fp) struct fc_frame *fp)
{ {
void (*recv)(struct fc_lport *, struct fc_frame *);
mutex_lock(&lport->lp_mutex); mutex_lock(&lport->lp_mutex);
/* /*
...@@ -902,31 +900,31 @@ static void fc_lport_recv_els_req(struct fc_lport *lport, ...@@ -902,31 +900,31 @@ static void fc_lport_recv_els_req(struct fc_lport *lport,
/* /*
* Check opcode. * Check opcode.
*/ */
recv = fc_rport_recv_req;
switch (fc_frame_payload_op(fp)) { switch (fc_frame_payload_op(fp)) {
case ELS_FLOGI: case ELS_FLOGI:
if (!lport->point_to_multipoint) if (!lport->point_to_multipoint)
recv = fc_lport_recv_flogi_req; fc_lport_recv_flogi_req(lport, fp);
break; break;
case ELS_LOGO: case ELS_LOGO:
if (fc_frame_sid(fp) == FC_FID_FLOGI) if (fc_frame_sid(fp) == FC_FID_FLOGI)
recv = fc_lport_recv_logo_req; fc_lport_recv_logo_req(lport, fp);
break; break;
case ELS_RSCN: case ELS_RSCN:
recv = lport->tt.disc_recv_req; lport->tt.disc_recv_req(lport, fp);
break; break;
case ELS_ECHO: case ELS_ECHO:
recv = fc_lport_recv_echo_req; fc_lport_recv_echo_req(lport, fp);
break; break;
case ELS_RLIR: case ELS_RLIR:
recv = fc_lport_recv_rlir_req; fc_lport_recv_rlir_req(lport, fp);
break; break;
case ELS_RNID: case ELS_RNID:
recv = fc_lport_recv_rnid_req; fc_lport_recv_rnid_req(lport, fp);
break;
default:
fc_rport_recv_req(lport, fp);
break; break;
} }
recv(lport, fp);
} }
mutex_unlock(&lport->lp_mutex); mutex_unlock(&lport->lp_mutex);
} }
......
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