Skip to content

Commit af102b3

Browse files
committed
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull more SCSI updates from James Bottomley: "This is a set of minor small (and safe changes) that didn't make the initial pull request plus some bug fixes" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: mvsas: Remove set but not used variable 'id' scsi: qla2xxx: Remove two arguments from qlafx00_error_entry() scsi: qla2xxx: Make sure that qlafx00_ioctl_iosb_entry() initializes 'res' scsi: qla2xxx: Remove a set-but-not-used variable scsi: qla2xxx: Make qla2x00_sysfs_write_nvram() easier to analyze scsi: qla2xxx: Declare local functions 'static' scsi: qla2xxx: Improve several kernel-doc headers scsi: qla2xxx: Modify fall-through annotations scsi: 3w-sas: 3w-9xxx: Use unsigned char for cdb scsi: mvsas: Use dma_pool_zalloc scsi: target: Don't request modules that aren't even built scsi: target: Set response length for REPORT TARGET PORT GROUPS
2 parents cddfa11 + 33279c3 commit af102b3

File tree

16 files changed

+52
-50
lines changed

16 files changed

+52
-50
lines changed

drivers/scsi/3w-9xxx.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ static int twa_poll_status_gone(TW_Device_Extension *tw_dev, u32 flag, int secon
143143
static int twa_post_command_packet(TW_Device_Extension *tw_dev, int request_id, char internal);
144144
static int twa_reset_device_extension(TW_Device_Extension *tw_dev);
145145
static int twa_reset_sequence(TW_Device_Extension *tw_dev, int soft_reset);
146-
static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry *sglistarg);
146+
static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
147+
unsigned char *cdb, int use_sg,
148+
TW_SG_Entry *sglistarg);
147149
static void twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int request_id);
148150
static char *twa_string_lookup(twa_message_type *table, unsigned int aen_code);
149151

@@ -278,7 +280,7 @@ static int twa_aen_complete(TW_Device_Extension *tw_dev, int request_id)
278280
static int twa_aen_drain_queue(TW_Device_Extension *tw_dev, int no_check_reset)
279281
{
280282
int request_id = 0;
281-
char cdb[TW_MAX_CDB_LEN];
283+
unsigned char cdb[TW_MAX_CDB_LEN];
282284
TW_SG_Entry sglist[1];
283285
int finished = 0, count = 0;
284286
TW_Command_Full *full_command_packet;
@@ -423,7 +425,7 @@ static void twa_aen_queue_event(TW_Device_Extension *tw_dev, TW_Command_Apache_H
423425
/* This function will read the aen queue from the isr */
424426
static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id)
425427
{
426-
char cdb[TW_MAX_CDB_LEN];
428+
unsigned char cdb[TW_MAX_CDB_LEN];
427429
TW_SG_Entry sglist[1];
428430
TW_Command_Full *full_command_packet;
429431
int retval = 1;
@@ -1798,7 +1800,9 @@ static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_
17981800
static DEF_SCSI_QCMD(twa_scsi_queue)
17991801

18001802
/* This function hands scsi cdb's to the firmware */
1801-
static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry *sglistarg)
1803+
static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
1804+
unsigned char *cdb, int use_sg,
1805+
TW_SG_Entry *sglistarg)
18021806
{
18031807
TW_Command_Full *full_command_packet;
18041808
TW_Command_Apache *command_packet;

drivers/scsi/3w-sas.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,9 @@ static int twl_post_command_packet(TW_Device_Extension *tw_dev, int request_id)
287287
} /* End twl_post_command_packet() */
288288

289289
/* This function hands scsi cdb's to the firmware */
290-
static int twl_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry_ISO *sglistarg)
290+
static int twl_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
291+
unsigned char *cdb, int use_sg,
292+
TW_SG_Entry_ISO *sglistarg)
291293
{
292294
TW_Command_Full *full_command_packet;
293295
TW_Command_Apache *command_packet;
@@ -372,7 +374,7 @@ static int twl_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
372374
/* This function will read the aen queue from the isr */
373375
static int twl_aen_read_queue(TW_Device_Extension *tw_dev, int request_id)
374376
{
375-
char cdb[TW_MAX_CDB_LEN];
377+
unsigned char cdb[TW_MAX_CDB_LEN];
376378
TW_SG_Entry_ISO sglist[1];
377379
TW_Command_Full *full_command_packet;
378380
int retval = 1;
@@ -554,7 +556,7 @@ static int twl_poll_response(TW_Device_Extension *tw_dev, int request_id, int se
554556
static int twl_aen_drain_queue(TW_Device_Extension *tw_dev, int no_check_reset)
555557
{
556558
int request_id = 0;
557-
char cdb[TW_MAX_CDB_LEN];
559+
unsigned char cdb[TW_MAX_CDB_LEN];
558560
TW_SG_Entry_ISO sglist[1];
559561
int finished = 0, count = 0;
560562
TW_Command_Full *full_command_packet;

drivers/scsi/mvsas/mv_sas.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,12 +790,11 @@ static int mvs_task_prep(struct sas_task *task, struct mvs_info *mvi, int is_tmf
790790
slot->n_elem = n_elem;
791791
slot->slot_tag = tag;
792792

793-
slot->buf = dma_pool_alloc(mvi->dma_pool, GFP_ATOMIC, &slot->buf_dma);
793+
slot->buf = dma_pool_zalloc(mvi->dma_pool, GFP_ATOMIC, &slot->buf_dma);
794794
if (!slot->buf) {
795795
rc = -ENOMEM;
796796
goto err_out_tag;
797797
}
798-
memset(slot->buf, 0, MVS_SLOT_BUF_SZ);
799798

800799
tei.task = task;
801800
tei.hdr = &mvi->slot[tag];
@@ -1906,8 +1905,7 @@ static void mvs_work_queue(struct work_struct *work)
19061905

19071906
if (phy->phy_event & PHY_PLUG_OUT) {
19081907
u32 tmp;
1909-
struct sas_identify_frame *id;
1910-
id = (struct sas_identify_frame *)phy->frame_rcvd;
1908+
19111909
tmp = MVS_CHIP_DISP->read_phy_ctl(mvi, phy_no);
19121910
phy->phy_event &= ~PHY_PLUG_OUT;
19131911
if (!(tmp & PHY_READY_MASK)) {

drivers/scsi/qla2xxx/qla_attr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ qla2x00_sysfs_write_nvram(struct file *filp, struct kobject *kobj,
218218

219219
mutex_lock(&ha->optrom_mutex);
220220
if (qla2x00_chip_is_down(vha)) {
221-
mutex_unlock(&vha->hw->optrom_mutex);
221+
mutex_unlock(&ha->optrom_mutex);
222222
return -EAGAIN;
223223
}
224224

drivers/scsi/qla2xxx/qla_init.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea)
425425
__qla24xx_handle_gpdb_event(vha, ea);
426426
}
427427

428-
int qla_post_els_plogi_work(struct scsi_qla_host *vha, fc_port_t *fcport)
428+
static int qla_post_els_plogi_work(struct scsi_qla_host *vha, fc_port_t *fcport)
429429
{
430430
struct qla_work_evt *e;
431431

@@ -680,7 +680,7 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha,
680680
fcport);
681681
break;
682682
}
683-
/* drop through */
683+
/* fall through */
684684
default:
685685
if (fcport_is_smaller(fcport)) {
686686
/* local adapter is bigger */
@@ -1551,7 +1551,8 @@ void qla24xx_handle_relogin_event(scsi_qla_host_t *vha,
15511551
}
15521552

15531553

1554-
void qla_handle_els_plogi_done(scsi_qla_host_t *vha, struct event_arg *ea)
1554+
static void qla_handle_els_plogi_done(scsi_qla_host_t *vha,
1555+
struct event_arg *ea)
15551556
{
15561557
ql_dbg(ql_dbg_disc, vha, 0x2118,
15571558
"%s %d %8phC post PRLI\n",

drivers/scsi/qla2xxx/qla_iocb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,8 +1195,8 @@ qla24xx_walk_and_build_prot_sglist(struct qla_hw_data *ha, srb_t *sp,
11951195
* @sp: SRB command to process
11961196
* @cmd_pkt: Command type 3 IOCB
11971197
* @tot_dsds: Total number of segments to transfer
1198-
* @tot_prot_dsds:
1199-
* @fw_prot_opts:
1198+
* @tot_prot_dsds: Total number of segments with protection information
1199+
* @fw_prot_opts: Protection options to be passed to firmware
12001200
*/
12011201
inline int
12021202
qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt,

drivers/scsi/qla2xxx/qla_isr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static int qla2x00_error_entry(scsi_qla_host_t *, struct rsp_que *,
2525

2626
/**
2727
* qla2100_intr_handler() - Process interrupts for the ISP2100 and ISP2200.
28-
* @irq:
28+
* @irq: interrupt number
2929
* @dev_id: SCSI driver HA context
3030
*
3131
* Called by system whenever the host adapter generates an interrupt.
@@ -144,7 +144,7 @@ qla2x00_check_reg16_for_disconnect(scsi_qla_host_t *vha, uint16_t reg)
144144

145145
/**
146146
* qla2300_intr_handler() - Process interrupts for the ISP23xx and ISP63xx.
147-
* @irq:
147+
* @irq: interrupt number
148148
* @dev_id: SCSI driver HA context
149149
*
150150
* Called by system whenever the host adapter generates an interrupt.
@@ -3109,7 +3109,7 @@ qla2xxx_check_risc_status(scsi_qla_host_t *vha)
31093109

31103110
/**
31113111
* qla24xx_intr_handler() - Process interrupts for the ISP23xx and ISP24xx.
3112-
* @irq:
3112+
* @irq: interrupt number
31133113
* @dev_id: SCSI driver HA context
31143114
*
31153115
* Called by system whenever the host adapter generates an interrupt.

drivers/scsi/qla2xxx/qla_mbx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3478,9 +3478,9 @@ qla8044_read_serdes_word(scsi_qla_host_t *vha, uint32_t addr, uint32_t *data)
34783478
/**
34793479
* qla2x00_set_serdes_params() -
34803480
* @vha: HA context
3481-
* @sw_em_1g:
3482-
* @sw_em_2g:
3483-
* @sw_em_4g:
3481+
* @sw_em_1g: serial link options
3482+
* @sw_em_2g: serial link options
3483+
* @sw_em_4g: serial link options
34843484
*
34853485
* Returns
34863486
*/

drivers/scsi/qla2xxx/qla_mr.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,7 +2212,7 @@ qlafx00_ioctl_iosb_entry(scsi_qla_host_t *vha, struct req_que *req,
22122212
struct bsg_job *bsg_job;
22132213
struct fc_bsg_reply *bsg_reply;
22142214
struct srb_iocb *iocb_job;
2215-
int res;
2215+
int res = 0;
22162216
struct qla_mt_iocb_rsp_fx00 fstatus;
22172217
uint8_t *fw_sts_ptr;
22182218

@@ -2624,7 +2624,7 @@ qlafx00_status_cont_entry(struct rsp_que *rsp, sts_cont_entry_t *pkt)
26242624
* qlafx00_multistatus_entry() - Process Multi response queue entries.
26252625
* @vha: SCSI driver HA context
26262626
* @rsp: response queue
2627-
* @pkt:
2627+
* @pkt: received packet
26282628
*/
26292629
static void
26302630
qlafx00_multistatus_entry(struct scsi_qla_host *vha,
@@ -2681,12 +2681,10 @@ qlafx00_multistatus_entry(struct scsi_qla_host *vha,
26812681
* @vha: SCSI driver HA context
26822682
* @rsp: response queue
26832683
* @pkt: Entry pointer
2684-
* @estatus:
2685-
* @etype:
26862684
*/
26872685
static void
26882686
qlafx00_error_entry(scsi_qla_host_t *vha, struct rsp_que *rsp,
2689-
struct sts_entry_fx00 *pkt, uint8_t estatus, uint8_t etype)
2687+
struct sts_entry_fx00 *pkt)
26902688
{
26912689
srb_t *sp;
26922690
struct qla_hw_data *ha = vha->hw;
@@ -2695,9 +2693,6 @@ qlafx00_error_entry(scsi_qla_host_t *vha, struct rsp_que *rsp,
26952693
struct req_que *req = NULL;
26962694
int res = DID_ERROR << 16;
26972695

2698-
ql_dbg(ql_dbg_async, vha, 0x507f,
2699-
"type of error status in response: 0x%x\n", estatus);
2700-
27012696
req = ha->req_q_map[que];
27022697

27032698
sp = qla2x00_get_sp_from_handle(vha, func, req, pkt);
@@ -2745,9 +2740,11 @@ qlafx00_process_response_queue(struct scsi_qla_host *vha,
27452740

27462741
if (pkt->entry_status != 0 &&
27472742
pkt->entry_type != IOCTL_IOSB_TYPE_FX00) {
2743+
ql_dbg(ql_dbg_async, vha, 0x507f,
2744+
"type of error status in response: 0x%x\n",
2745+
pkt->entry_status);
27482746
qlafx00_error_entry(vha, rsp,
2749-
(struct sts_entry_fx00 *)pkt, pkt->entry_status,
2750-
pkt->entry_type);
2747+
(struct sts_entry_fx00 *)pkt);
27512748
continue;
27522749
}
27532750

@@ -2867,7 +2864,7 @@ qlafx00_async_event(scsi_qla_host_t *vha)
28672864
/**
28682865
* qlafx00x_mbx_completion() - Process mailbox command completions.
28692866
* @vha: SCSI driver HA context
2870-
* @mb0:
2867+
* @mb0: value to be written into mailbox register 0
28712868
*/
28722869
static void
28732870
qlafx00_mbx_completion(scsi_qla_host_t *vha, uint32_t mb0)
@@ -2893,7 +2890,7 @@ qlafx00_mbx_completion(scsi_qla_host_t *vha, uint32_t mb0)
28932890

28942891
/**
28952892
* qlafx00_intr_handler() - Process interrupts for the ISPFX00.
2896-
* @irq:
2893+
* @irq: interrupt number
28972894
* @dev_id: SCSI driver HA context
28982895
*
28992896
* Called by system whenever the host adapter generates an interrupt.

drivers/scsi/qla2xxx/qla_nx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2010,7 +2010,7 @@ qla82xx_mbx_completion(scsi_qla_host_t *vha, uint16_t mb0)
20102010

20112011
/**
20122012
* qla82xx_intr_handler() - Process interrupts for the ISP23xx and ISP63xx.
2013-
* @irq:
2013+
* @irq: interrupt number
20142014
* @dev_id: SCSI driver HA context
20152015
*
20162016
* Called by system whenever the host adapter generates an interrupt.

drivers/scsi/qla2xxx/qla_nx2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3878,7 +3878,7 @@ qla8044_write_optrom_data(struct scsi_qla_host *vha, uint8_t *buf,
38783878
#define PF_BITS_MASK (0xF << 16)
38793879
/**
38803880
* qla8044_intr_handler() - Process interrupts for the ISP8044
3881-
* @irq:
3881+
* @irq: interrupt number
38823882
* @dev_id: SCSI driver HA context
38833883
*
38843884
* Called by system whenever the host adapter generates an interrupt.

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,7 +1749,7 @@ qla2x00_loop_reset(scsi_qla_host_t *vha)
17491749
static void
17501750
__qla2x00_abort_all_cmds(struct qla_qpair *qp, int res)
17511751
{
1752-
int cnt, status;
1752+
int cnt;
17531753
unsigned long flags;
17541754
srb_t *sp;
17551755
scsi_qla_host_t *vha = qp->vha;
@@ -1799,8 +1799,8 @@ __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res)
17991799
if (!sp_get(sp)) {
18001800
spin_unlock_irqrestore
18011801
(qp->qp_lock_ptr, flags);
1802-
status = qla2xxx_eh_abort(
1803-
GET_CMD_SP(sp));
1802+
qla2xxx_eh_abort(
1803+
GET_CMD_SP(sp));
18041804
spin_lock_irqsave
18051805
(qp->qp_lock_ptr, flags);
18061806
}

drivers/scsi/qla2xxx/qla_sup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2229,7 +2229,7 @@ qla2x00_erase_flash_sector(struct qla_hw_data *ha, uint32_t addr,
22292229

22302230
/**
22312231
* qla2x00_get_flash_manufacturer() - Read manufacturer ID from flash chip.
2232-
* @ha:
2232+
* @ha: host adapter
22332233
* @man_id: Flash manufacturer ID
22342234
* @flash_id: Flash ID
22352235
*/

drivers/scsi/qla2xxx/qla_target.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4540,7 +4540,7 @@ static int qlt_issue_task_mgmt(struct fc_port *sess, u64 lun,
45404540
case QLA_TGT_CLEAR_TS:
45414541
case QLA_TGT_ABORT_TS:
45424542
abort_cmds_for_lun(vha, lun, a->u.isp24.fcp_hdr.s_id);
4543-
/* drop through */
4543+
/* fall through */
45444544
case QLA_TGT_CLEAR_ACA:
45454545
h = qlt_find_qphint(vha, mcmd->unpacked_lun);
45464546
mcmd->qpair = h->qpair;
@@ -6598,9 +6598,9 @@ static void qlt_lport_dump(struct scsi_qla_host *vha, u64 wwpn,
65986598
* qla_tgt_lport_register - register lport with external module
65996599
*
66006600
* @target_lport_ptr: pointer for tcm_qla2xxx specific lport data
6601-
* @phys_wwpn:
6602-
* @npiv_wwpn:
6603-
* @npiv_wwnn:
6601+
* @phys_wwpn: physical port WWPN
6602+
* @npiv_wwpn: NPIV WWPN
6603+
* @npiv_wwnn: NPIV WWNN
66046604
* @callback: lport initialization callback for tcm_qla2xxx code
66056605
*/
66066606
int qlt_lport_register(void *target_lport_ptr, u64 phys_wwpn,

drivers/target/target_core_alua.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ target_emulate_report_target_port_groups(struct se_cmd *cmd)
268268
}
269269
transport_kunmap_data_sg(cmd);
270270

271-
target_complete_cmd(cmd, GOOD);
271+
target_complete_cmd_with_length(cmd, GOOD, rd_len + 4);
272272
return 0;
273273
}
274274

drivers/target/target_core_transport.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,19 +205,19 @@ void transport_subsystem_check_init(void)
205205
if (sub_api_initialized)
206206
return;
207207

208-
ret = request_module("target_core_iblock");
208+
ret = IS_ENABLED(CONFIG_TCM_IBLOCK) && request_module("target_core_iblock");
209209
if (ret != 0)
210210
pr_err("Unable to load target_core_iblock\n");
211211

212-
ret = request_module("target_core_file");
212+
ret = IS_ENABLED(CONFIG_TCM_FILEIO) && request_module("target_core_file");
213213
if (ret != 0)
214214
pr_err("Unable to load target_core_file\n");
215215

216-
ret = request_module("target_core_pscsi");
216+
ret = IS_ENABLED(CONFIG_TCM_PSCSI) && request_module("target_core_pscsi");
217217
if (ret != 0)
218218
pr_err("Unable to load target_core_pscsi\n");
219219

220-
ret = request_module("target_core_user");
220+
ret = IS_ENABLED(CONFIG_TCM_USER2) && request_module("target_core_user");
221221
if (ret != 0)
222222
pr_err("Unable to load target_core_user\n");
223223

0 commit comments

Comments
 (0)