Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: libfc: Replace ->lport_recv with function call

The ->lport_recv callback only ever had one implementation,
so call the function directly and remove the callback.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Acked-by: Johannes Thumshirn <jth@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Hannes Reinecke and committed by
Martin K. Petersen
c5cb444c 31c0a631

+6 -15
+2 -2
drivers/scsi/libfc/fc_exch.c
··· 1527 1527 * The upper-level protocol may request one later, if needed. 1528 1528 */ 1529 1529 if (fh->fh_rx_id == htons(FC_XID_UNKNOWN)) 1530 - return lport->tt.lport_recv(lport, fp); 1530 + return fc_lport_recv(lport, fp); 1531 1531 1532 1532 reject = fc_seq_lookup_recip(lport, mp, fp); 1533 1533 if (reject == FC_RJT_NONE) { ··· 1548 1548 * first. 1549 1549 */ 1550 1550 if (!fc_invoke_resp(ep, sp, fp)) 1551 - lport->tt.lport_recv(lport, fp); 1551 + fc_lport_recv(lport, fp); 1552 1552 fc_exch_release(ep); /* release from lookup */ 1553 1553 } else { 1554 1554 FC_LPORT_DBG(lport, "exch/seq lookup failed: reject %x\n",
+3 -6
drivers/scsi/libfc/fc_lport.c
··· 944 944 }; 945 945 946 946 /** 947 - * fc_lport_recv_req() - The generic lport request handler 947 + * fc_lport_recv() - The generic lport request handler 948 948 * @lport: The lport that received the request 949 949 * @fp: The frame the request is in 950 950 * 951 951 * Locking Note: This function should not be called with the lport 952 952 * lock held because it may grab the lock. 953 953 */ 954 - static void fc_lport_recv_req(struct fc_lport *lport, 955 - struct fc_frame *fp) 954 + void fc_lport_recv(struct fc_lport *lport, struct fc_frame *fp) 956 955 { 957 956 struct fc_frame_header *fh = fc_frame_header_get(fp); 958 957 struct fc_seq *sp = fr_seq(fp); ··· 982 983 if (sp) 983 984 lport->tt.exch_done(sp); 984 985 } 986 + EXPORT_SYMBOL(fc_lport_recv); 985 987 986 988 /** 987 989 * fc_lport_reset() - Reset a local port ··· 1865 1865 */ 1866 1866 int fc_lport_init(struct fc_lport *lport) 1867 1867 { 1868 - if (!lport->tt.lport_recv) 1869 - lport->tt.lport_recv = fc_lport_recv_req; 1870 - 1871 1868 fc_host_port_type(lport->host) = FC_PORTTYPE_NPORT; 1872 1869 fc_host_node_name(lport->host) = lport->wwnn; 1873 1870 fc_host_port_name(lport->host) = lport->wwpn;
+1 -7
include/scsi/libfc.h
··· 621 621 void (*rport_flush_queue)(void); 622 622 623 623 /* 624 - * Receive a frame for a local port. 625 - * 626 - * STATUS: OPTIONAL 627 - */ 628 - void (*lport_recv)(struct fc_lport *, struct fc_frame *); 629 - 630 - /* 631 624 * Set the local port FC_ID. 632 625 * 633 626 * This may be provided by the LLD to allow it to be ··· 1053 1060 void fc_vports_linkchange(struct fc_lport *); 1054 1061 int fc_lport_config(struct fc_lport *); 1055 1062 int fc_lport_reset(struct fc_lport *); 1063 + void fc_lport_recv(struct fc_lport *lport, struct fc_frame *fp); 1056 1064 int fc_set_mfs(struct fc_lport *, u32 mfs); 1057 1065 struct fc_lport *libfc_vport_create(struct fc_vport *, int privsize); 1058 1066 struct fc_lport *fc_vport_id_lookup(struct fc_lport *, u32 port_id);