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

Commit b89e8f53 authored by Xiangliang Yu's avatar Xiangliang Yu Committed by James Bottomley
Browse files

[SCSI] mvsas: Remove unused macros, variables and functions



Remove unused macros: VSR_PHY_VS0, VSR_PHY_VS1, MVS_SLOTS,
	MVS_CAN_QUEUE, MVS_MSI, SG_MX, _MV_DUMP, MV_DISABLE_NCQ
Remove unused variables for mvs_info: irq, exp_req, cmd_size
Remove unused functions: mvs_get_sas_addr, mvs_hexdump,
	mvs_hba_sb_dump, mvs_hab_memory_dump, mvs_hba_cq_dump

Signed-off-by: default avatarXiangliang Yu <yuxiangl@marvell.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 8882f081
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -803,7 +803,6 @@ const struct mvs_dispatch mvs_64xx_dispatch = {
	mvs_write_port_irq_stat,
	mvs_write_port_irq_stat,
	mvs_read_port_irq_mask,
	mvs_read_port_irq_mask,
	mvs_write_port_irq_mask,
	mvs_write_port_irq_mask,
	mvs_get_sas_addr,
	mvs_64xx_command_active,
	mvs_64xx_command_active,
	mvs_64xx_clear_srs_irq,
	mvs_64xx_clear_srs_irq,
	mvs_64xx_issue_stop,
	mvs_64xx_issue_stop,
+0 −1
Original line number Original line Diff line number Diff line
@@ -947,7 +947,6 @@ const struct mvs_dispatch mvs_94xx_dispatch = {
	mvs_write_port_irq_stat,
	mvs_write_port_irq_stat,
	mvs_read_port_irq_mask,
	mvs_read_port_irq_mask,
	mvs_write_port_irq_mask,
	mvs_write_port_irq_mask,
	mvs_get_sas_addr,
	mvs_94xx_command_active,
	mvs_94xx_command_active,
	mvs_94xx_clear_srs_irq,
	mvs_94xx_clear_srs_irq,
	mvs_94xx_issue_stop,
	mvs_94xx_issue_stop,
+0 −2
Original line number Original line Diff line number Diff line
@@ -132,8 +132,6 @@ enum sas_sata_vsp_regs {
	VSR_PHY_MODE9		= 0x09 * 4, /* Test */
	VSR_PHY_MODE9		= 0x09 * 4, /* Test */
	VSR_PHY_MODE10		= 0x0A * 4, /* Power */
	VSR_PHY_MODE10		= 0x0A * 4, /* Power */
	VSR_PHY_MODE11		= 0x0B * 4, /* Phy Mode */
	VSR_PHY_MODE11		= 0x0B * 4, /* Phy Mode */
	VSR_PHY_VS0		= 0x0C * 4, /* Vednor Specific 0 */
	VSR_PHY_VS1		= 0x0D * 4, /* Vednor Specific 1 */


	VSR_PHY_FFE_CONTROL	= 0x10C,
	VSR_PHY_FFE_CONTROL	= 0x10C,
	VSR_PHY_DFE_UPDATE_CRTL	= 0x110,
	VSR_PHY_DFE_UPDATE_CRTL	= 0x110,
+1 −4
Original line number Original line Diff line number Diff line
@@ -43,7 +43,6 @@ enum chip_flavors {


/* driver compile-time configuration */
/* driver compile-time configuration */
enum driver_configuration {
enum driver_configuration {
	MVS_SLOTS		= 512,	/* command slots */
	MVS_TX_RING_SZ		= 1024,	/* TX ring size (12-bit) */
	MVS_TX_RING_SZ		= 1024,	/* TX ring size (12-bit) */
	MVS_RX_RING_SZ		= 1024, /* RX ring size (12-bit) */
	MVS_RX_RING_SZ		= 1024, /* RX ring size (12-bit) */
					/* software requires power-of-2
					/* software requires power-of-2
@@ -56,8 +55,7 @@ enum driver_configuration {
	MVS_SSP_CMD_SZ		= 64,	/* SSP command table buffer size */
	MVS_SSP_CMD_SZ		= 64,	/* SSP command table buffer size */
	MVS_ATA_CMD_SZ		= 96,	/* SATA command table buffer size */
	MVS_ATA_CMD_SZ		= 96,	/* SATA command table buffer size */
	MVS_OAF_SZ		= 64,	/* Open address frame buffer size */
	MVS_OAF_SZ		= 64,	/* Open address frame buffer size */
	MVS_QUEUE_SIZE	= 32,	/* Support Queue depth */
	MVS_QUEUE_SIZE		= 64,	/* Support Queue depth */
	MVS_CAN_QUEUE		= MVS_SLOTS - 2,	/* SCSI Queue depth */
	MVS_SOC_CAN_QUEUE	= MVS_SOC_SLOTS - 2,
	MVS_SOC_CAN_QUEUE	= MVS_SOC_SLOTS - 2,
};
};


@@ -392,7 +390,6 @@ enum sas_cmd_port_registers {
};
};


enum mvs_info_flags {
enum mvs_info_flags {
	MVF_MSI		= (1U << 0),	/* MSI is enabled */
	MVF_PHY_PWR_FIX	= (1U << 1),	/* bug workaround */
	MVF_PHY_PWR_FIX	= (1U << 1),	/* bug workaround */
	MVF_FLAG_SOC		= (1U << 2),	/* SoC integrated controllers */
	MVF_FLAG_SOC		= (1U << 2),	/* SoC integrated controllers */
};
};
+14 −10
Original line number Original line Diff line number Diff line
@@ -53,7 +53,6 @@ static const struct mvs_chip_info mvs_chips[] = {
struct device_attribute *mvst_host_attrs[];
struct device_attribute *mvst_host_attrs[];


#define SOC_SAS_NUM 2
#define SOC_SAS_NUM 2
#define SG_MX 64


static struct scsi_host_template mvs_sht = {
static struct scsi_host_template mvs_sht = {
	.module			= THIS_MODULE,
	.module			= THIS_MODULE,
@@ -70,7 +69,7 @@ static struct scsi_host_template mvs_sht = {
	.can_queue		= 1,
	.can_queue		= 1,
	.cmd_per_lun		= 1,
	.cmd_per_lun		= 1,
	.this_id		= -1,
	.this_id		= -1,
	.sg_tablesize		= SG_MX,
	.sg_tablesize		= SG_ALL,
	.max_sectors		= SCSI_DEFAULT_MAX_SECTORS,
	.max_sectors		= SCSI_DEFAULT_MAX_SECTORS,
	.use_clustering		= ENABLE_CLUSTERING,
	.use_clustering		= ENABLE_CLUSTERING,
	.eh_device_reset_handler = sas_eh_device_reset_handler,
	.eh_device_reset_handler = sas_eh_device_reset_handler,
@@ -133,7 +132,7 @@ static void mvs_free(struct mvs_info *mvi)
	if (mvi->flags & MVF_FLAG_SOC)
	if (mvi->flags & MVF_FLAG_SOC)
		slot_nr = MVS_SOC_SLOTS;
		slot_nr = MVS_SOC_SLOTS;
	else
	else
		slot_nr = MVS_SLOTS;
		slot_nr = MVS_CHIP_SLOT_SZ;


	if (mvi->dma_pool)
	if (mvi->dma_pool)
		pci_pool_destroy(mvi->dma_pool);
		pci_pool_destroy(mvi->dma_pool);
@@ -166,6 +165,7 @@ static void mvs_free(struct mvs_info *mvi)
		scsi_host_put(mvi->shost);
		scsi_host_put(mvi->shost);
	list_for_each_entry(mwq, &mvi->wq_list, entry)
	list_for_each_entry(mwq, &mvi->wq_list, entry)
		cancel_delayed_work(&mwq->work_q);
		cancel_delayed_work(&mwq->work_q);
	kfree(mvi->tags);
	kfree(mvi);
	kfree(mvi);
}
}


@@ -232,7 +232,7 @@ static int __devinit mvs_alloc(struct mvs_info *mvi, struct Scsi_Host *shost)
	if (mvi->flags & MVF_FLAG_SOC)
	if (mvi->flags & MVF_FLAG_SOC)
		slot_nr = MVS_SOC_SLOTS;
		slot_nr = MVS_SOC_SLOTS;
	else
	else
		slot_nr = MVS_SLOTS;
		slot_nr = MVS_CHIP_SLOT_SZ;


	spin_lock_init(&mvi->lock);
	spin_lock_init(&mvi->lock);
	for (i = 0; i < mvi->chip->n_phy; i++) {
	for (i = 0; i < mvi->chip->n_phy; i++) {
@@ -369,8 +369,9 @@ static struct mvs_info *__devinit mvs_pci_alloc(struct pci_dev *pdev,
	struct mvs_info *mvi;
	struct mvs_info *mvi;
	struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
	struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);


	mvi = kzalloc(sizeof(*mvi) + MVS_SLOTS * sizeof(struct mvs_slot_info),
	mvi = kzalloc(sizeof(*mvi) +
			GFP_KERNEL);
		(1L << mvs_chips[ent->driver_data].slot_width) *
		sizeof(struct mvs_slot_info), GFP_KERNEL);
	if (!mvi)
	if (!mvi)
		return NULL;
		return NULL;


@@ -379,7 +380,6 @@ static struct mvs_info *__devinit mvs_pci_alloc(struct pci_dev *pdev,
	mvi->chip_id = ent->driver_data;
	mvi->chip_id = ent->driver_data;
	mvi->chip = &mvs_chips[mvi->chip_id];
	mvi->chip = &mvs_chips[mvi->chip_id];
	INIT_LIST_HEAD(&mvi->wq_list);
	INIT_LIST_HEAD(&mvi->wq_list);
	mvi->irq = pdev->irq;


	((struct mvs_prv_info *)sha->lldd_ha)->mvi[id] = mvi;
	((struct mvs_prv_info *)sha->lldd_ha)->mvi[id] = mvi;
	((struct mvs_prv_info *)sha->lldd_ha)->n_phy = mvi->chip->n_phy;
	((struct mvs_prv_info *)sha->lldd_ha)->n_phy = mvi->chip->n_phy;
@@ -391,6 +391,10 @@ static struct mvs_info *__devinit mvs_pci_alloc(struct pci_dev *pdev,
	tasklet_init(&mv_tasklet, mvs_tasklet, (unsigned long)sha);
	tasklet_init(&mv_tasklet, mvs_tasklet, (unsigned long)sha);
#endif
#endif


	mvi->tags = kzalloc(MVS_CHIP_SLOT_SZ>>3, GFP_KERNEL);
	if (!mvi->tags)
		goto err_out;

	if (MVS_CHIP_DISP->chip_ioremap(mvi))
	if (MVS_CHIP_DISP->chip_ioremap(mvi))
		goto err_out;
		goto err_out;
	if (!mvs_alloc(mvi, shost))
	if (!mvs_alloc(mvi, shost))
@@ -505,11 +509,11 @@ static void __devinit mvs_post_sas_ha_init(struct Scsi_Host *shost,
	if (mvi->flags & MVF_FLAG_SOC)
	if (mvi->flags & MVF_FLAG_SOC)
		can_queue = MVS_SOC_CAN_QUEUE;
		can_queue = MVS_SOC_CAN_QUEUE;
	else
	else
		can_queue = MVS_CAN_QUEUE;
		can_queue = MVS_CHIP_SLOT_SZ;


	sha->lldd_queue_size = can_queue;
	sha->lldd_queue_size = can_queue;
	shost->can_queue = can_queue;
	shost->can_queue = can_queue;
	mvi->shost->cmd_per_lun = MVS_SLOTS/sha->num_phys;
	mvi->shost->cmd_per_lun = MVS_QUEUE_SIZE;
	sha->core.shost = mvi->shost;
	sha->core.shost = mvi->shost;
}
}


@@ -650,7 +654,7 @@ static void __devexit mvs_pci_remove(struct pci_dev *pdev)
	scsi_remove_host(mvi->shost);
	scsi_remove_host(mvi->shost);


	MVS_CHIP_DISP->interrupt_disable(mvi);
	MVS_CHIP_DISP->interrupt_disable(mvi);
	free_irq(mvi->irq, sha);
	free_irq(mvi->pdev->irq, sha);
	for (i = 0; i < core_nr; i++) {
	for (i = 0; i < core_nr; i++) {
		mvi = ((struct mvs_prv_info *)sha->lldd_ha)->mvi[i];
		mvi = ((struct mvs_prv_info *)sha->lldd_ha)->mvi[i];
		mvs_free(mvi);
		mvs_free(mvi);
Loading