diff options
author | Bart Van Assche <bvanassche@acm.org> | 2019-08-08 23:02:04 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-08-12 21:34:08 -0400 |
commit | 6c18a43e3c82b0b67531a1cdec7ba31540fe6424 (patch) | |
tree | 9dd7c82433a12aff3d64c1f2129894d4e94e0eb9 | |
parent | aa20e38bf567ff81a7778c769be6f5cea098174b (diff) |
scsi: qla2xxx: Enable type checking for the SRB free and done callback functions
Since all pointers passed to the srb_t.done() and srb_t.free() functions
have type srb_t, change the type of the first argument of these functions
from void * into struct srb *. This allows the compiler to verify the
argument types for these functions. This patch does not change any
functionality.
Cc: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_bsg.c | 8 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 14 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gbl.h | 14 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gs.c | 21 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 40 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_iocb.c | 12 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 4 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mid.c | 4 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mr.c | 4 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_nvme.c | 11 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_nvme.h | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 16 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.c | 4 |
13 files changed, 54 insertions, 100 deletions
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index 240b07b0098a..28d587a89ba6 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c | |||
@@ -12,10 +12,8 @@ | |||
12 | #include <linux/bsg-lib.h> | 12 | #include <linux/bsg-lib.h> |
13 | 13 | ||
14 | /* BSG support for ELS/CT pass through */ | 14 | /* BSG support for ELS/CT pass through */ |
15 | void | 15 | void qla2x00_bsg_job_done(srb_t *sp, int res) |
16 | qla2x00_bsg_job_done(void *ptr, int res) | ||
17 | { | 16 | { |
18 | srb_t *sp = ptr; | ||
19 | struct bsg_job *bsg_job = sp->u.bsg_job; | 17 | struct bsg_job *bsg_job = sp->u.bsg_job; |
20 | struct fc_bsg_reply *bsg_reply = bsg_job->reply; | 18 | struct fc_bsg_reply *bsg_reply = bsg_job->reply; |
21 | 19 | ||
@@ -25,10 +23,8 @@ qla2x00_bsg_job_done(void *ptr, int res) | |||
25 | sp->free(sp); | 23 | sp->free(sp); |
26 | } | 24 | } |
27 | 25 | ||
28 | void | 26 | void qla2x00_bsg_sp_free(srb_t *sp) |
29 | qla2x00_bsg_sp_free(void *ptr) | ||
30 | { | 27 | { |
31 | srb_t *sp = ptr; | ||
32 | struct qla_hw_data *ha = sp->vha->hw; | 28 | struct qla_hw_data *ha = sp->vha->hw; |
33 | struct bsg_job *bsg_job = sp->u.bsg_job; | 29 | struct bsg_job *bsg_job = sp->u.bsg_job; |
34 | struct fc_bsg_request *bsg_request = bsg_job->request; | 30 | struct fc_bsg_request *bsg_request = bsg_job->request; |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 779bf3fcab0f..65d79bcb7ccf 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -614,8 +614,18 @@ typedef struct srb { | |||
614 | struct bsg_job *bsg_job; | 614 | struct bsg_job *bsg_job; |
615 | struct srb_cmd scmd; | 615 | struct srb_cmd scmd; |
616 | } u; | 616 | } u; |
617 | void (*done)(void *, int); | 617 | /* |
618 | void (*free)(void *); | 618 | * Report completion status @res and call sp_put(@sp). @res is |
619 | * an NVMe status code, a SCSI result (e.g. DID_OK << 16) or a | ||
620 | * QLA_* status value. | ||
621 | */ | ||
622 | void (*done)(struct srb *sp, int res); | ||
623 | /* Stop the timer and free @sp. Only used by the FCP code. */ | ||
624 | void (*free)(struct srb *sp); | ||
625 | /* | ||
626 | * Call nvme_private->fd->done() and free @sp. Only used by the NVMe | ||
627 | * code. | ||
628 | */ | ||
619 | void (*put_fn)(struct kref *kref); | 629 | void (*put_fn)(struct kref *kref); |
620 | } srb_t; | 630 | } srb_t; |
621 | 631 | ||
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index aac664da419b..bbfbe3a34a7e 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h | |||
@@ -213,9 +213,9 @@ extern int qla2x00_post_uevent_work(struct scsi_qla_host *, u32); | |||
213 | 213 | ||
214 | extern int qla2x00_post_uevent_work(struct scsi_qla_host *, u32); | 214 | extern int qla2x00_post_uevent_work(struct scsi_qla_host *, u32); |
215 | extern void qla2x00_disable_board_on_pci_error(struct work_struct *); | 215 | extern void qla2x00_disable_board_on_pci_error(struct work_struct *); |
216 | extern void qla2x00_sp_compl(void *, int); | 216 | extern void qla2x00_sp_compl(srb_t *sp, int); |
217 | extern void qla2xxx_qpair_sp_free_dma(void *); | 217 | extern void qla2xxx_qpair_sp_free_dma(srb_t *sp); |
218 | extern void qla2xxx_qpair_sp_compl(void *, int); | 218 | extern void qla2xxx_qpair_sp_compl(srb_t *sp, int); |
219 | extern void qla24xx_sched_upd_fcport(fc_port_t *); | 219 | extern void qla24xx_sched_upd_fcport(fc_port_t *); |
220 | void qla2x00_handle_login_done_event(struct scsi_qla_host *, fc_port_t *, | 220 | void qla2x00_handle_login_done_event(struct scsi_qla_host *, fc_port_t *, |
221 | uint16_t *); | 221 | uint16_t *); |
@@ -244,7 +244,7 @@ extern void qla2x00_do_dpc_all_vps(scsi_qla_host_t *); | |||
244 | extern int qla24xx_vport_create_req_sanity_check(struct fc_vport *); | 244 | extern int qla24xx_vport_create_req_sanity_check(struct fc_vport *); |
245 | extern scsi_qla_host_t *qla24xx_create_vhost(struct fc_vport *); | 245 | extern scsi_qla_host_t *qla24xx_create_vhost(struct fc_vport *); |
246 | 246 | ||
247 | extern void qla2x00_sp_free_dma(void *); | 247 | extern void qla2x00_sp_free_dma(srb_t *sp); |
248 | extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *); | 248 | extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *); |
249 | 249 | ||
250 | extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int, int); | 250 | extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int, int); |
@@ -790,10 +790,10 @@ extern int qla82xx_restart_isp(scsi_qla_host_t *); | |||
790 | 790 | ||
791 | /* IOCB related functions */ | 791 | /* IOCB related functions */ |
792 | extern int qla82xx_start_scsi(srb_t *); | 792 | extern int qla82xx_start_scsi(srb_t *); |
793 | extern void qla2x00_sp_free(void *); | 793 | extern void qla2x00_sp_free(srb_t *sp); |
794 | extern void qla2x00_sp_timeout(struct timer_list *); | 794 | extern void qla2x00_sp_timeout(struct timer_list *); |
795 | extern void qla2x00_bsg_job_done(void *, int); | 795 | extern void qla2x00_bsg_job_done(srb_t *sp, int); |
796 | extern void qla2x00_bsg_sp_free(void *); | 796 | extern void qla2x00_bsg_sp_free(srb_t *sp); |
797 | extern void qla2x00_start_iocbs(struct scsi_qla_host *, struct req_que *); | 797 | extern void qla2x00_start_iocbs(struct scsi_qla_host *, struct req_que *); |
798 | 798 | ||
799 | /* Interrupt related */ | 799 | /* Interrupt related */ |
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 18117b5f32bc..35e1f36c9366 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c | |||
@@ -499,9 +499,8 @@ qla2x00_gnn_id(scsi_qla_host_t *vha, sw_info_t *list) | |||
499 | return (rval); | 499 | return (rval); |
500 | } | 500 | } |
501 | 501 | ||
502 | static void qla2x00_async_sns_sp_done(void *s, int rc) | 502 | static void qla2x00_async_sns_sp_done(srb_t *sp, int rc) |
503 | { | 503 | { |
504 | struct srb *sp = s; | ||
505 | struct scsi_qla_host *vha = sp->vha; | 504 | struct scsi_qla_host *vha = sp->vha; |
506 | struct ct_sns_pkt *ct_sns; | 505 | struct ct_sns_pkt *ct_sns; |
507 | struct qla_work_evt *e; | 506 | struct qla_work_evt *e; |
@@ -2989,9 +2988,8 @@ void qla24xx_handle_gpsc_event(scsi_qla_host_t *vha, struct event_arg *ea) | |||
2989 | qla_post_iidma_work(vha, fcport); | 2988 | qla_post_iidma_work(vha, fcport); |
2990 | } | 2989 | } |
2991 | 2990 | ||
2992 | static void qla24xx_async_gpsc_sp_done(void *s, int res) | 2991 | static void qla24xx_async_gpsc_sp_done(srb_t *sp, int res) |
2993 | { | 2992 | { |
2994 | struct srb *sp = s; | ||
2995 | struct scsi_qla_host *vha = sp->vha; | 2993 | struct scsi_qla_host *vha = sp->vha; |
2996 | struct qla_hw_data *ha = vha->hw; | 2994 | struct qla_hw_data *ha = vha->hw; |
2997 | fc_port_t *fcport = sp->fcport; | 2995 | fc_port_t *fcport = sp->fcport; |
@@ -3258,9 +3256,8 @@ void qla24xx_handle_gpnid_event(scsi_qla_host_t *vha, struct event_arg *ea) | |||
3258 | } | 3256 | } |
3259 | } | 3257 | } |
3260 | 3258 | ||
3261 | static void qla2x00_async_gpnid_sp_done(void *s, int res) | 3259 | static void qla2x00_async_gpnid_sp_done(srb_t *sp, int res) |
3262 | { | 3260 | { |
3263 | struct srb *sp = s; | ||
3264 | struct scsi_qla_host *vha = sp->vha; | 3261 | struct scsi_qla_host *vha = sp->vha; |
3265 | struct ct_sns_req *ct_req = | 3262 | struct ct_sns_req *ct_req = |
3266 | (struct ct_sns_req *)sp->u.iocb_cmd.u.ctarg.req; | 3263 | (struct ct_sns_req *)sp->u.iocb_cmd.u.ctarg.req; |
@@ -3446,9 +3443,8 @@ void qla24xx_handle_gffid_event(scsi_qla_host_t *vha, struct event_arg *ea) | |||
3446 | qla24xx_post_gnl_work(vha, fcport); | 3443 | qla24xx_post_gnl_work(vha, fcport); |
3447 | } | 3444 | } |
3448 | 3445 | ||
3449 | void qla24xx_async_gffid_sp_done(void *s, int res) | 3446 | void qla24xx_async_gffid_sp_done(srb_t *sp, int res) |
3450 | { | 3447 | { |
3451 | struct srb *sp = s; | ||
3452 | struct scsi_qla_host *vha = sp->vha; | 3448 | struct scsi_qla_host *vha = sp->vha; |
3453 | fc_port_t *fcport = sp->fcport; | 3449 | fc_port_t *fcport = sp->fcport; |
3454 | struct ct_sns_rsp *ct_rsp; | 3450 | struct ct_sns_rsp *ct_rsp; |
@@ -3872,9 +3868,8 @@ static void qla2x00_find_free_fcp_nvme_slot(struct scsi_qla_host *vha, | |||
3872 | } | 3868 | } |
3873 | } | 3869 | } |
3874 | 3870 | ||
3875 | static void qla2x00_async_gpnft_gnnft_sp_done(void *s, int res) | 3871 | static void qla2x00_async_gpnft_gnnft_sp_done(srb_t *sp, int res) |
3876 | { | 3872 | { |
3877 | struct srb *sp = s; | ||
3878 | struct scsi_qla_host *vha = sp->vha; | 3873 | struct scsi_qla_host *vha = sp->vha; |
3879 | struct ct_sns_req *ct_req = | 3874 | struct ct_sns_req *ct_req = |
3880 | (struct ct_sns_req *)sp->u.iocb_cmd.u.ctarg.req; | 3875 | (struct ct_sns_req *)sp->u.iocb_cmd.u.ctarg.req; |
@@ -4251,9 +4246,8 @@ void qla24xx_handle_gnnid_event(scsi_qla_host_t *vha, struct event_arg *ea) | |||
4251 | qla24xx_post_gnl_work(vha, ea->fcport); | 4246 | qla24xx_post_gnl_work(vha, ea->fcport); |
4252 | } | 4247 | } |
4253 | 4248 | ||
4254 | static void qla2x00_async_gnnid_sp_done(void *s, int res) | 4249 | static void qla2x00_async_gnnid_sp_done(srb_t *sp, int res) |
4255 | { | 4250 | { |
4256 | struct srb *sp = s; | ||
4257 | struct scsi_qla_host *vha = sp->vha; | 4251 | struct scsi_qla_host *vha = sp->vha; |
4258 | fc_port_t *fcport = sp->fcport; | 4252 | fc_port_t *fcport = sp->fcport; |
4259 | u8 *node_name = fcport->ct_desc.ct_sns->p.rsp.rsp.gnn_id.node_name; | 4253 | u8 *node_name = fcport->ct_desc.ct_sns->p.rsp.rsp.gnn_id.node_name; |
@@ -4384,9 +4378,8 @@ void qla24xx_handle_gfpnid_event(scsi_qla_host_t *vha, struct event_arg *ea) | |||
4384 | qla24xx_post_gpsc_work(vha, fcport); | 4378 | qla24xx_post_gpsc_work(vha, fcport); |
4385 | } | 4379 | } |
4386 | 4380 | ||
4387 | static void qla2x00_async_gfpnid_sp_done(void *s, int res) | 4381 | static void qla2x00_async_gfpnid_sp_done(srb_t *sp, int res) |
4388 | { | 4382 | { |
4389 | struct srb *sp = s; | ||
4390 | struct scsi_qla_host *vha = sp->vha; | 4383 | struct scsi_qla_host *vha = sp->vha; |
4391 | fc_port_t *fcport = sp->fcport; | 4384 | fc_port_t *fcport = sp->fcport; |
4392 | u8 *fpn = fcport->ct_desc.ct_sns->p.rsp.rsp.gfpn_id.port_name; | 4385 | u8 *fpn = fcport->ct_desc.ct_sns->p.rsp.rsp.gfpn_id.port_name; |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index a6a66b5d36a3..3fa8ca63429c 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -63,10 +63,8 @@ qla2x00_sp_timeout(struct timer_list *t) | |||
63 | iocb->timeout(sp); | 63 | iocb->timeout(sp); |
64 | } | 64 | } |
65 | 65 | ||
66 | void | 66 | void qla2x00_sp_free(srb_t *sp) |
67 | qla2x00_sp_free(void *ptr) | ||
68 | { | 67 | { |
69 | srb_t *sp = ptr; | ||
70 | struct srb_iocb *iocb = &sp->u.iocb_cmd; | 68 | struct srb_iocb *iocb = &sp->u.iocb_cmd; |
71 | 69 | ||
72 | del_timer(&iocb->timer); | 70 | del_timer(&iocb->timer); |
@@ -117,9 +115,8 @@ static void qla24xx_abort_iocb_timeout(void *data) | |||
117 | sp->done(sp, QLA_OS_TIMER_EXPIRED); | 115 | sp->done(sp, QLA_OS_TIMER_EXPIRED); |
118 | } | 116 | } |
119 | 117 | ||
120 | static void qla24xx_abort_sp_done(void *ptr, int res) | 118 | static void qla24xx_abort_sp_done(srb_t *sp, int res) |
121 | { | 119 | { |
122 | srb_t *sp = ptr; | ||
123 | struct srb_iocb *abt = &sp->u.iocb_cmd; | 120 | struct srb_iocb *abt = &sp->u.iocb_cmd; |
124 | 121 | ||
125 | del_timer(&sp->u.iocb_cmd.timer); | 122 | del_timer(&sp->u.iocb_cmd.timer); |
@@ -249,10 +246,8 @@ qla2x00_async_iocb_timeout(void *data) | |||
249 | } | 246 | } |
250 | } | 247 | } |
251 | 248 | ||
252 | static void | 249 | static void qla2x00_async_login_sp_done(srb_t *sp, int res) |
253 | qla2x00_async_login_sp_done(void *ptr, int res) | ||
254 | { | 250 | { |
255 | srb_t *sp = ptr; | ||
256 | struct scsi_qla_host *vha = sp->vha; | 251 | struct scsi_qla_host *vha = sp->vha; |
257 | struct srb_iocb *lio = &sp->u.iocb_cmd; | 252 | struct srb_iocb *lio = &sp->u.iocb_cmd; |
258 | struct event_arg ea; | 253 | struct event_arg ea; |
@@ -358,11 +353,8 @@ done: | |||
358 | return rval; | 353 | return rval; |
359 | } | 354 | } |
360 | 355 | ||
361 | static void | 356 | static void qla2x00_async_logout_sp_done(srb_t *sp, int res) |
362 | qla2x00_async_logout_sp_done(void *ptr, int res) | ||
363 | { | 357 | { |
364 | srb_t *sp = ptr; | ||
365 | |||
366 | sp->fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); | 358 | sp->fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); |
367 | sp->fcport->login_gen++; | 359 | sp->fcport->login_gen++; |
368 | qlt_logo_completion_handler(sp->fcport, res); | 360 | qlt_logo_completion_handler(sp->fcport, res); |
@@ -419,10 +411,8 @@ qla2x00_async_prlo_done(struct scsi_qla_host *vha, fc_port_t *fcport, | |||
419 | qlt_logo_completion_handler(fcport, data[0]); | 411 | qlt_logo_completion_handler(fcport, data[0]); |
420 | } | 412 | } |
421 | 413 | ||
422 | static void | 414 | static void qla2x00_async_prlo_sp_done(srb_t *sp, int res) |
423 | qla2x00_async_prlo_sp_done(void *s, int res) | ||
424 | { | 415 | { |
425 | srb_t *sp = (srb_t *)s; | ||
426 | struct srb_iocb *lio = &sp->u.iocb_cmd; | 416 | struct srb_iocb *lio = &sp->u.iocb_cmd; |
427 | struct scsi_qla_host *vha = sp->vha; | 417 | struct scsi_qla_host *vha = sp->vha; |
428 | 418 | ||
@@ -525,10 +515,8 @@ static int qla_post_els_plogi_work(struct scsi_qla_host *vha, fc_port_t *fcport) | |||
525 | return qla2x00_post_work(vha, e); | 515 | return qla2x00_post_work(vha, e); |
526 | } | 516 | } |
527 | 517 | ||
528 | static void | 518 | static void qla2x00_async_adisc_sp_done(srb_t *sp, int res) |
529 | qla2x00_async_adisc_sp_done(void *ptr, int res) | ||
530 | { | 519 | { |
531 | srb_t *sp = ptr; | ||
532 | struct scsi_qla_host *vha = sp->vha; | 520 | struct scsi_qla_host *vha = sp->vha; |
533 | struct event_arg ea; | 521 | struct event_arg ea; |
534 | struct srb_iocb *lio = &sp->u.iocb_cmd; | 522 | struct srb_iocb *lio = &sp->u.iocb_cmd; |
@@ -931,10 +919,8 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, | |||
931 | } | 919 | } |
932 | } /* gnl_event */ | 920 | } /* gnl_event */ |
933 | 921 | ||
934 | static void | 922 | static void qla24xx_async_gnl_sp_done(srb_t *sp, int res) |
935 | qla24xx_async_gnl_sp_done(void *s, int res) | ||
936 | { | 923 | { |
937 | struct srb *sp = s; | ||
938 | struct scsi_qla_host *vha = sp->vha; | 924 | struct scsi_qla_host *vha = sp->vha; |
939 | unsigned long flags; | 925 | unsigned long flags; |
940 | struct fc_port *fcport = NULL, *tf; | 926 | struct fc_port *fcport = NULL, *tf; |
@@ -1121,10 +1107,8 @@ int qla24xx_post_gnl_work(struct scsi_qla_host *vha, fc_port_t *fcport) | |||
1121 | return qla2x00_post_work(vha, e); | 1107 | return qla2x00_post_work(vha, e); |
1122 | } | 1108 | } |
1123 | 1109 | ||
1124 | static | 1110 | static void qla24xx_async_gpdb_sp_done(srb_t *sp, int res) |
1125 | void qla24xx_async_gpdb_sp_done(void *s, int res) | ||
1126 | { | 1111 | { |
1127 | struct srb *sp = s; | ||
1128 | struct scsi_qla_host *vha = sp->vha; | 1112 | struct scsi_qla_host *vha = sp->vha; |
1129 | struct qla_hw_data *ha = vha->hw; | 1113 | struct qla_hw_data *ha = vha->hw; |
1130 | fc_port_t *fcport = sp->fcport; | 1114 | fc_port_t *fcport = sp->fcport; |
@@ -1168,10 +1152,8 @@ static int qla24xx_post_prli_work(struct scsi_qla_host *vha, fc_port_t *fcport) | |||
1168 | return qla2x00_post_work(vha, e); | 1152 | return qla2x00_post_work(vha, e); |
1169 | } | 1153 | } |
1170 | 1154 | ||
1171 | static void | 1155 | static void qla2x00_async_prli_sp_done(srb_t *sp, int res) |
1172 | qla2x00_async_prli_sp_done(void *ptr, int res) | ||
1173 | { | 1156 | { |
1174 | srb_t *sp = ptr; | ||
1175 | struct scsi_qla_host *vha = sp->vha; | 1157 | struct scsi_qla_host *vha = sp->vha; |
1176 | struct srb_iocb *lio = &sp->u.iocb_cmd; | 1158 | struct srb_iocb *lio = &sp->u.iocb_cmd; |
1177 | struct event_arg ea; | 1159 | struct event_arg ea; |
@@ -1808,10 +1790,8 @@ qla2x00_tmf_iocb_timeout(void *data) | |||
1808 | complete(&tmf->u.tmf.comp); | 1790 | complete(&tmf->u.tmf.comp); |
1809 | } | 1791 | } |
1810 | 1792 | ||
1811 | static void | 1793 | static void qla2x00_tmf_sp_done(srb_t *sp, int res) |
1812 | qla2x00_tmf_sp_done(void *ptr, int res) | ||
1813 | { | 1794 | { |
1814 | srb_t *sp = ptr; | ||
1815 | struct srb_iocb *tmf = &sp->u.iocb_cmd; | 1795 | struct srb_iocb *tmf = &sp->u.iocb_cmd; |
1816 | 1796 | ||
1817 | complete(&tmf->u.tmf.comp); | 1797 | complete(&tmf->u.tmf.comp); |
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 2da7c92e320b..59a0a778d31c 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c | |||
@@ -2544,10 +2544,8 @@ void qla2x00_init_timer(srb_t *sp, unsigned long tmo) | |||
2544 | sp->start_timer = 1; | 2544 | sp->start_timer = 1; |
2545 | } | 2545 | } |
2546 | 2546 | ||
2547 | static void | 2547 | static void qla2x00_els_dcmd_sp_free(srb_t *sp) |
2548 | qla2x00_els_dcmd_sp_free(void *data) | ||
2549 | { | 2548 | { |
2550 | srb_t *sp = data; | ||
2551 | struct srb_iocb *elsio = &sp->u.iocb_cmd; | 2549 | struct srb_iocb *elsio = &sp->u.iocb_cmd; |
2552 | 2550 | ||
2553 | kfree(sp->fcport); | 2551 | kfree(sp->fcport); |
@@ -2577,10 +2575,8 @@ qla2x00_els_dcmd_iocb_timeout(void *data) | |||
2577 | complete(&lio->u.els_logo.comp); | 2575 | complete(&lio->u.els_logo.comp); |
2578 | } | 2576 | } |
2579 | 2577 | ||
2580 | static void | 2578 | static void qla2x00_els_dcmd_sp_done(srb_t *sp, int res) |
2581 | qla2x00_els_dcmd_sp_done(void *ptr, int res) | ||
2582 | { | 2579 | { |
2583 | srb_t *sp = ptr; | ||
2584 | fc_port_t *fcport = sp->fcport; | 2580 | fc_port_t *fcport = sp->fcport; |
2585 | struct srb_iocb *lio = &sp->u.iocb_cmd; | 2581 | struct srb_iocb *lio = &sp->u.iocb_cmd; |
2586 | struct scsi_qla_host *vha = sp->vha; | 2582 | struct scsi_qla_host *vha = sp->vha; |
@@ -2758,10 +2754,8 @@ qla2x00_els_dcmd2_iocb_timeout(void *data) | |||
2758 | sp->done(sp, QLA_FUNCTION_TIMEOUT); | 2754 | sp->done(sp, QLA_FUNCTION_TIMEOUT); |
2759 | } | 2755 | } |
2760 | 2756 | ||
2761 | static void | 2757 | static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) |
2762 | qla2x00_els_dcmd2_sp_done(void *ptr, int res) | ||
2763 | { | 2758 | { |
2764 | srb_t *sp = ptr; | ||
2765 | fc_port_t *fcport = sp->fcport; | 2759 | fc_port_t *fcport = sp->fcport; |
2766 | struct srb_iocb *lio = &sp->u.iocb_cmd; | 2760 | struct srb_iocb *lio = &sp->u.iocb_cmd; |
2767 | struct scsi_qla_host *vha = sp->vha; | 2761 | struct scsi_qla_host *vha = sp->vha; |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 783a84606047..a82b6db2fa9d 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -6217,10 +6217,8 @@ qla26xx_dport_diagnostics(scsi_qla_host_t *vha, | |||
6217 | return rval; | 6217 | return rval; |
6218 | } | 6218 | } |
6219 | 6219 | ||
6220 | static void qla2x00_async_mb_sp_done(void *s, int res) | 6220 | static void qla2x00_async_mb_sp_done(srb_t *sp, int res) |
6221 | { | 6221 | { |
6222 | struct srb *sp = s; | ||
6223 | |||
6224 | sp->u.iocb_cmd.u.mbx.rc = res; | 6222 | sp->u.iocb_cmd.u.mbx.rc = res; |
6225 | 6223 | ||
6226 | complete(&sp->u.iocb_cmd.u.mbx.comp); | 6224 | complete(&sp->u.iocb_cmd.u.mbx.comp); |
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index b2977e49356b..1a9a11ae7285 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c | |||
@@ -901,10 +901,8 @@ failed: | |||
901 | return 0; | 901 | return 0; |
902 | } | 902 | } |
903 | 903 | ||
904 | static void qla_ctrlvp_sp_done(void *s, int res) | 904 | static void qla_ctrlvp_sp_done(srb_t *sp, int res) |
905 | { | 905 | { |
906 | struct srb *sp = s; | ||
907 | |||
908 | if (sp->comp) | 906 | if (sp->comp) |
909 | complete(sp->comp); | 907 | complete(sp->comp); |
910 | /* don't free sp here. Let the caller do the free */ | 908 | /* don't free sp here. Let the caller do the free */ |
diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c index 78b3679e1b9c..e8da3ec4db2c 100644 --- a/drivers/scsi/qla2xxx/qla_mr.c +++ b/drivers/scsi/qla2xxx/qla_mr.c | |||
@@ -1797,10 +1797,8 @@ qla2x00_fxdisc_iocb_timeout(void *data) | |||
1797 | complete(&lio->u.fxiocb.fxiocb_comp); | 1797 | complete(&lio->u.fxiocb.fxiocb_comp); |
1798 | } | 1798 | } |
1799 | 1799 | ||
1800 | static void | 1800 | static void qla2x00_fxdisc_sp_done(srb_t *sp, int res) |
1801 | qla2x00_fxdisc_sp_done(void *ptr, int res) | ||
1802 | { | 1801 | { |
1803 | srb_t *sp = ptr; | ||
1804 | struct srb_iocb *lio = &sp->u.iocb_cmd; | 1802 | struct srb_iocb *lio = &sp->u.iocb_cmd; |
1805 | 1803 | ||
1806 | complete(&lio->u.fxiocb.fxiocb_comp); | 1804 | complete(&lio->u.fxiocb.fxiocb_comp); |
diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index bba25c38a118..af6b46777602 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c | |||
@@ -180,10 +180,9 @@ static void qla_nvme_ls_complete(struct work_struct *work) | |||
180 | kref_put(&priv->sp->cmd_kref, qla_nvme_release_ls_cmd_kref); | 180 | kref_put(&priv->sp->cmd_kref, qla_nvme_release_ls_cmd_kref); |
181 | } | 181 | } |
182 | 182 | ||
183 | static void qla_nvme_sp_ls_done(void *ptr, int res) | 183 | static void qla_nvme_sp_ls_done(srb_t *sp, int res) |
184 | { | 184 | { |
185 | srb_t *sp = ptr; | 185 | struct nvme_private *priv = sp->priv; |
186 | struct nvme_private *priv; | ||
187 | 186 | ||
188 | if (WARN_ON_ONCE(kref_read(&sp->cmd_kref) == 0)) | 187 | if (WARN_ON_ONCE(kref_read(&sp->cmd_kref) == 0)) |
189 | return; | 188 | return; |
@@ -191,17 +190,15 @@ static void qla_nvme_sp_ls_done(void *ptr, int res) | |||
191 | if (res) | 190 | if (res) |
192 | res = -EINVAL; | 191 | res = -EINVAL; |
193 | 192 | ||
194 | priv = (struct nvme_private *)sp->priv; | ||
195 | priv->comp_status = res; | 193 | priv->comp_status = res; |
196 | INIT_WORK(&priv->ls_work, qla_nvme_ls_complete); | 194 | INIT_WORK(&priv->ls_work, qla_nvme_ls_complete); |
197 | schedule_work(&priv->ls_work); | 195 | schedule_work(&priv->ls_work); |
198 | } | 196 | } |
199 | 197 | ||
200 | /* it assumed that QPair lock is held. */ | 198 | /* it assumed that QPair lock is held. */ |
201 | static void qla_nvme_sp_done(void *ptr, int res) | 199 | static void qla_nvme_sp_done(srb_t *sp, int res) |
202 | { | 200 | { |
203 | srb_t *sp = ptr; | 201 | struct nvme_private *priv = sp->priv; |
204 | struct nvme_private *priv = (struct nvme_private *)sp->priv; | ||
205 | 202 | ||
206 | priv->comp_status = res; | 203 | priv->comp_status = res; |
207 | kref_put(&sp->cmd_kref, qla_nvme_release_fcp_cmd_kref); | 204 | kref_put(&sp->cmd_kref, qla_nvme_release_fcp_cmd_kref); |
diff --git a/drivers/scsi/qla2xxx/qla_nvme.h b/drivers/scsi/qla2xxx/qla_nvme.h index 68a8d09a36ef..25a2b82d5095 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.h +++ b/drivers/scsi/qla2xxx/qla_nvme.h | |||
@@ -144,5 +144,5 @@ int qla_nvme_register_remote(struct scsi_qla_host *, struct fc_port *); | |||
144 | void qla_nvme_delete(struct scsi_qla_host *); | 144 | void qla_nvme_delete(struct scsi_qla_host *); |
145 | void qla24xx_nvme_ls4_iocb(struct scsi_qla_host *, struct pt_ls4_request *, | 145 | void qla24xx_nvme_ls4_iocb(struct scsi_qla_host *, struct pt_ls4_request *, |
146 | struct req_que *); | 146 | struct req_que *); |
147 | void qla24xx_async_gffid_sp_done(void *, int); | 147 | void qla24xx_async_gffid_sp_done(struct srb *sp, int); |
148 | #endif | 148 | #endif |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index a247dce0cb95..9ef59995f5d6 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -652,10 +652,8 @@ qla24xx_fw_version_str(struct scsi_qla_host *vha, char *str, size_t size) | |||
652 | return str; | 652 | return str; |
653 | } | 653 | } |
654 | 654 | ||
655 | void | 655 | void qla2x00_sp_free_dma(srb_t *sp) |
656 | qla2x00_sp_free_dma(void *ptr) | ||
657 | { | 656 | { |
658 | srb_t *sp = ptr; | ||
659 | struct qla_hw_data *ha = sp->vha->hw; | 657 | struct qla_hw_data *ha = sp->vha->hw; |
660 | struct scsi_cmnd *cmd = GET_CMD_SP(sp); | 658 | struct scsi_cmnd *cmd = GET_CMD_SP(sp); |
661 | void *ctx = GET_CMD_CTX_SP(sp); | 659 | void *ctx = GET_CMD_CTX_SP(sp); |
@@ -699,10 +697,8 @@ qla2x00_sp_free_dma(void *ptr) | |||
699 | } | 697 | } |
700 | } | 698 | } |
701 | 699 | ||
702 | void | 700 | void qla2x00_sp_compl(srb_t *sp, int res) |
703 | qla2x00_sp_compl(void *ptr, int res) | ||
704 | { | 701 | { |
705 | srb_t *sp = ptr; | ||
706 | struct scsi_cmnd *cmd = GET_CMD_SP(sp); | 702 | struct scsi_cmnd *cmd = GET_CMD_SP(sp); |
707 | struct completion *comp = sp->comp; | 703 | struct completion *comp = sp->comp; |
708 | 704 | ||
@@ -720,10 +716,8 @@ qla2x00_sp_compl(void *ptr, int res) | |||
720 | qla2x00_rel_sp(sp); | 716 | qla2x00_rel_sp(sp); |
721 | } | 717 | } |
722 | 718 | ||
723 | void | 719 | void qla2xxx_qpair_sp_free_dma(srb_t *sp) |
724 | qla2xxx_qpair_sp_free_dma(void *ptr) | ||
725 | { | 720 | { |
726 | srb_t *sp = (srb_t *)ptr; | ||
727 | struct scsi_cmnd *cmd = GET_CMD_SP(sp); | 721 | struct scsi_cmnd *cmd = GET_CMD_SP(sp); |
728 | struct qla_hw_data *ha = sp->fcport->vha->hw; | 722 | struct qla_hw_data *ha = sp->fcport->vha->hw; |
729 | void *ctx = GET_CMD_CTX_SP(sp); | 723 | void *ctx = GET_CMD_CTX_SP(sp); |
@@ -804,10 +798,8 @@ qla2xxx_qpair_sp_free_dma(void *ptr) | |||
804 | } | 798 | } |
805 | } | 799 | } |
806 | 800 | ||
807 | void | 801 | void qla2xxx_qpair_sp_compl(srb_t *sp, int res) |
808 | qla2xxx_qpair_sp_compl(void *ptr, int res) | ||
809 | { | 802 | { |
810 | srb_t *sp = ptr; | ||
811 | struct scsi_cmnd *cmd = GET_CMD_SP(sp); | 803 | struct scsi_cmnd *cmd = GET_CMD_SP(sp); |
812 | struct completion *comp = sp->comp; | 804 | struct completion *comp = sp->comp; |
813 | 805 | ||
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index f7b72d1d4862..d25c3fa43601 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c | |||
@@ -559,10 +559,8 @@ static int qla24xx_post_nack_work(struct scsi_qla_host *vha, fc_port_t *fcport, | |||
559 | return qla2x00_post_work(vha, e); | 559 | return qla2x00_post_work(vha, e); |
560 | } | 560 | } |
561 | 561 | ||
562 | static | 562 | static void qla2x00_async_nack_sp_done(srb_t *sp, int res) |
563 | void qla2x00_async_nack_sp_done(void *s, int res) | ||
564 | { | 563 | { |
565 | struct srb *sp = (struct srb *)s; | ||
566 | struct scsi_qla_host *vha = sp->vha; | 564 | struct scsi_qla_host *vha = sp->vha; |
567 | unsigned long flags; | 565 | unsigned long flags; |
568 | 566 | ||