Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa492630 authored by Saurav Kashyap's avatar Saurav Kashyap Committed by James Bottomley
Browse files

[SCSI] qla2xxx: Fix for warnings reported by sparse.

parent 681e014b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -526,8 +526,8 @@ qla25xx_copy_mq(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)
		ha->max_req_queues : ha->max_rsp_queues;
	mq->count = htonl(que_cnt);
	for (cnt = 0; cnt < que_cnt; cnt++) {
		reg = (struct device_reg_25xxmq *) ((void *)
			ha->mqiobase + cnt * QLA_QUE_PAGE);
		reg = (struct device_reg_25xxmq __iomem *)
			(ha->mqiobase + cnt * QLA_QUE_PAGE);
		que_idx = cnt * 4;
		mq->qregs[que_idx] = htonl(RD_REG_DWORD(&reg->req_q_in));
		mq->qregs[que_idx+1] = htonl(RD_REG_DWORD(&reg->req_q_out));
+2 −2
Original line number Diff line number Diff line
@@ -2486,9 +2486,9 @@ struct bidi_statistics {
#define QLA_MAX_QUEUES 256
#define ISP_QUE_REG(ha, id) \
	((ha->mqenable || IS_QLA83XX(ha)) ? \
	((void *)(ha->mqiobase) +\
	((device_reg_t __iomem *)(ha->mqiobase) +\
	(QLA_QUE_PAGE * id)) :\
	((void *)(ha->iobase)))
	((device_reg_t __iomem *)(ha->iobase)))
#define QLA_REQ_QUE_ID(tag) \
	((tag < QLA_MAX_QUEUES && tag > 0) ? tag : 0)
#define QLA_DEFAULT_QUE_QOS 5
+0 −1
Original line number Diff line number Diff line
@@ -598,7 +598,6 @@ extern void qla82xx_init_flags(struct qla_hw_data *);

/* ISP 8021 hardware related */
extern void qla82xx_set_drv_active(scsi_qla_host_t *);
extern void qla82xx_crb_win_unlock(struct qla_hw_data *);
extern int qla82xx_wr_32(struct qla_hw_data *, ulong, u32);
extern int qla82xx_rd_32(struct qla_hw_data *, ulong);
extern int qla82xx_rdmem(struct qla_hw_data *, u64, void *, int);
+7 −55
Original line number Diff line number Diff line
@@ -429,7 +429,7 @@ qla2x00_async_adisc_done(struct scsi_qla_host *vha, fc_port_t *fcport,
/*                QLogic ISP2x00 Hardware Support Functions.                */
/****************************************************************************/

int
static int
qla83xx_nic_core_fw_load(scsi_qla_host_t *vha)
{
	int rval = QLA_SUCCESS;
@@ -997,7 +997,7 @@ qla2x00_reset_chip(scsi_qla_host_t *vha)
 *
 * Returns 0 on success.
 */
int
static int
qla81xx_reset_mpi(scsi_qla_host_t *vha)
{
	uint16_t mb[4] = {0x1010, 0, 1, 0};
@@ -3865,7 +3865,7 @@ qla83xx_reset_ownership(scsi_qla_host_t *vha)
	}
}

int
static int
__qla83xx_set_drv_ack(scsi_qla_host_t *vha)
{
	int rval = QLA_SUCCESS;
@@ -3881,19 +3881,7 @@ __qla83xx_set_drv_ack(scsi_qla_host_t *vha)
	return rval;
}

int
qla83xx_set_drv_ack(scsi_qla_host_t *vha)
{
	int rval = QLA_SUCCESS;

	qla83xx_idc_lock(vha, 0);
	rval = __qla83xx_set_drv_ack(vha);
	qla83xx_idc_unlock(vha, 0);

	return rval;
}

int
static int
__qla83xx_clear_drv_ack(scsi_qla_host_t *vha)
{
	int rval = QLA_SUCCESS;
@@ -3909,19 +3897,7 @@ __qla83xx_clear_drv_ack(scsi_qla_host_t *vha)
	return rval;
}

int
qla83xx_clear_drv_ack(scsi_qla_host_t *vha)
{
	int rval = QLA_SUCCESS;

	qla83xx_idc_lock(vha, 0);
	rval = __qla83xx_clear_drv_ack(vha);
	qla83xx_idc_unlock(vha, 0);

	return rval;
}

const char *
static const char *
qla83xx_dev_state_to_string(uint32_t dev_state)
{
	switch (dev_state) {
@@ -3975,7 +3951,7 @@ qla83xx_idc_audit(scsi_qla_host_t *vha, int audit_type)
}

/* Assumes idc_lock always held on entry */
int
static int
qla83xx_initiating_reset(scsi_qla_host_t *vha)
{
	struct qla_hw_data *ha = vha->hw;
@@ -4022,37 +3998,13 @@ __qla83xx_set_idc_control(scsi_qla_host_t *vha, uint32_t idc_control)
	return qla83xx_wr_reg(vha, QLA83XX_IDC_CONTROL, idc_control);
}

int
qla83xx_set_idc_control(scsi_qla_host_t *vha, uint32_t idc_control)
{
	int rval = QLA_SUCCESS;

	qla83xx_idc_lock(vha, 0);
	rval = __qla83xx_set_idc_control(vha, idc_control);
	qla83xx_idc_unlock(vha, 0);

	return rval;
}

int
__qla83xx_get_idc_control(scsi_qla_host_t *vha, uint32_t *idc_control)
{
	return qla83xx_rd_reg(vha, QLA83XX_IDC_CONTROL, idc_control);
}

int
qla83xx_get_idc_control(scsi_qla_host_t *vha, uint32_t *idc_control)
{
	int rval = QLA_SUCCESS;

	qla83xx_idc_lock(vha, 0);
	rval = __qla83xx_get_idc_control(vha, idc_control);
	qla83xx_idc_unlock(vha, 0);

	return rval;
}

int
static int
qla83xx_check_driver_presence(scsi_qla_host_t *vha)
{
	uint32_t drv_presence = 0;
+2 −2
Original line number Diff line number Diff line
@@ -520,7 +520,7 @@ __qla2x00_marker(struct scsi_qla_host *vha, struct req_que *req,

	mrk24 = NULL;
	req = ha->req_q_map[0];
	mrk = (mrk_entry_t *)qla2x00_alloc_iocbs(vha, 0);
	mrk = (mrk_entry_t *)qla2x00_alloc_iocbs(vha, NULL);
	if (mrk == NULL) {
		ql_log(ql_log_warn, base_vha, 0x3026,
		    "Failed to allocate Marker IOCB.\n");
@@ -2551,7 +2551,7 @@ qla82xx_start_scsi(srb_t *sp)
			(unsigned long __iomem *)ha->nxdb_wr_ptr,
			dbval);
		wmb();
		while (RD_REG_DWORD(ha->nxdb_rd_ptr) != dbval) {
		while (RD_REG_DWORD((void __iomem *)ha->nxdb_rd_ptr) != dbval) {
			WRT_REG_DWORD(
				(unsigned long __iomem *)ha->nxdb_wr_ptr,
				dbval);
Loading