Commit 5fc136f3 authored by Martin K. Petersen's avatar Martin K. Petersen
Browse files

Merge patch series "qla2xxx klocwork fixes"

Nilesh Javali <njavali@marvell.com> says:

Please apply the qla2xxx driver klocwork fixes to the scsi tree at
your earliest convenience.

Link: https://lore.kernel.org/r/20230607113843.37185-1-njavali@marvell.com


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parents 51031cc3 991e7ac6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -283,6 +283,10 @@ qla2x00_process_els(struct bsg_job *bsg_job)

	if (bsg_request->msgcode == FC_BSG_RPT_ELS) {
		rport = fc_bsg_to_rport(bsg_job);
		if (!rport) {
			rval = -ENOMEM;
			goto done;
		}
		fcport = *(fc_port_t **) rport->dd_data;
		host = rport_to_shost(rport);
		vha = shost_priv(host);
@@ -2992,6 +2996,8 @@ qla24xx_bsg_request(struct bsg_job *bsg_job)

	if (bsg_request->msgcode == FC_BSG_RPT_ELS) {
		rport = fc_bsg_to_rport(bsg_job);
		if (!rport)
			return ret;
		host = rport_to_shost(rport);
		vha = shost_priv(host);
	} else {
+2 −2
Original line number Diff line number Diff line
@@ -2362,7 +2362,7 @@ qla24xx_issue_sa_replace_iocb(scsi_qla_host_t *vha, struct qla_work_evt *e)
		ql_dbg(ql_dbg_edif, vha, 0x70e6,
		    "sa_ctl allocation failed\n");
		rval = -ENOMEM;
		goto done;
		return rval;
	}

	fcport = sa_ctl->fcport;
+1 −1
Original line number Diff line number Diff line
@@ -5549,7 +5549,7 @@ static void qla_get_login_template(scsi_qla_host_t *vha)
	__be32 *q;

	memset(ha->init_cb, 0, ha->init_cb_size);
	sz = min_t(int, sizeof(struct fc_els_flogi), ha->init_cb_size);
	sz = min_t(int, sizeof(struct fc_els_csp), ha->init_cb_size);
	rval = qla24xx_get_port_login_templ(vha, ha->init_cb_dma,
					    ha->init_cb, sz);
	if (rval != QLA_SUCCESS) {
+4 −1
Original line number Diff line number Diff line
@@ -109,11 +109,13 @@ qla2x00_set_fcport_disc_state(fc_port_t *fcport, int state)
{
	int old_val;
	uint8_t shiftbits, mask;
	uint8_t port_dstate_str_sz;

	/* This will have to change when the max no. of states > 16 */
	shiftbits = 4;
	mask = (1 << shiftbits) - 1;

	port_dstate_str_sz = sizeof(port_dstate_str) / sizeof(char *);
	fcport->disc_state = state;
	while (1) {
		old_val = atomic_read(&fcport->shadow_disc_state);
@@ -121,7 +123,8 @@ qla2x00_set_fcport_disc_state(fc_port_t *fcport, int state)
		    old_val, (old_val << shiftbits) | state)) {
			ql_dbg(ql_dbg_disc, fcport->vha, 0x2134,
			    "FCPort %8phC disc_state transition: %s to %s - portid=%06x.\n",
			    fcport->port_name, port_dstate_str[old_val & mask],
			    fcport->port_name, (old_val & mask) < port_dstate_str_sz ?
				    port_dstate_str[old_val & mask] : "Unknown",
			    port_dstate_str[state], fcport->d_id.b24);
			return;
		}
+2 −1
Original line number Diff line number Diff line
@@ -607,7 +607,8 @@ qla24xx_build_scsi_type_6_iocbs(srb_t *sp, struct cmd_type_6 *cmd_pkt,
	put_unaligned_le32(COMMAND_TYPE_6, &cmd_pkt->entry_type);

	/* No data transfer */
	if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) {
	if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE ||
	    tot_dsds == 0) {
		cmd_pkt->byte_count = cpu_to_le32(0);
		return 0;
	}
Loading