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

Commit da0dc9fb authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by James Bottomley
Browse files

megaraid_sas: fix whitespace errors



Fix whitespace and indentation errors.  No code change.

[jejb: checkpatch fixes]
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Acked-by: default avatarSumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent 1be18254
Loading
Loading
Loading
Loading
+118 −126
Original line number Diff line number Diff line
@@ -273,6 +273,7 @@ static inline void
megasas_enable_intr_xscale(struct megasas_instance *instance)
{
	struct megasas_register_set __iomem *regs;

	regs = instance->reg_set;
	writel(0, &(regs)->outbound_intr_mask);

@@ -289,6 +290,7 @@ megasas_disable_intr_xscale(struct megasas_instance *instance)
{
	struct megasas_register_set __iomem *regs;
	u32 mask = 0x1f;

	regs = instance->reg_set;
	writel(mask, &regs->outbound_intr_mask);
	/* Dummy readl to force pci flush */
@@ -313,6 +315,7 @@ megasas_clear_intr_xscale(struct megasas_register_set __iomem * regs)
{
	u32 status;
	u32 mfiStatus = 0;

	/*
	 * Check if it is our interrupt
	 */
@@ -348,6 +351,7 @@ megasas_fire_cmd_xscale(struct megasas_instance *instance,
		struct megasas_register_set __iomem *regs)
{
	unsigned long flags;

	spin_lock_irqsave(&instance->hba_lock, flags);
	writel((frame_phys_addr >> 3)|(frame_count),
	       &(regs)->inbound_queue_port);
@@ -364,6 +368,7 @@ megasas_adp_reset_xscale(struct megasas_instance *instance,
{
	u32 i;
	u32 pcidata;

	writel(MFI_ADP_RESET, &regs->inbound_doorbell);

	for (i = 0; i < 3; i++)
@@ -402,7 +407,6 @@ static int
megasas_check_reset_xscale(struct megasas_instance *instance,
		struct megasas_register_set __iomem *regs)
{

	if ((instance->adprecovery != MEGASAS_HBA_OPERATIONAL) &&
	    (le32_to_cpu(*instance->consumer) ==
		MEGASAS_ADPRESET_INPROG_SIGN))
@@ -444,6 +448,7 @@ static inline void
megasas_enable_intr_ppc(struct megasas_instance *instance)
{
	struct megasas_register_set __iomem *regs;

	regs = instance->reg_set;
	writel(0xFFFFFFFF, &(regs)->outbound_doorbell_clear);

@@ -462,6 +467,7 @@ megasas_disable_intr_ppc(struct megasas_instance *instance)
{
	struct megasas_register_set __iomem *regs;
	u32 mask = 0xFFFFFFFF;

	regs = instance->reg_set;
	writel(mask, &regs->outbound_intr_mask);
	/* Dummy readl to force pci flush */
@@ -522,6 +528,7 @@ megasas_fire_cmd_ppc(struct megasas_instance *instance,
		struct megasas_register_set __iomem *regs)
{
	unsigned long flags;

	spin_lock_irqsave(&instance->hba_lock, flags);
	writel((frame_phys_addr | (frame_count<<1))|1,
			&(regs)->inbound_queue_port);
@@ -566,6 +573,7 @@ static inline void
megasas_enable_intr_skinny(struct megasas_instance *instance)
{
	struct megasas_register_set __iomem *regs;

	regs = instance->reg_set;
	writel(0xFFFFFFFF, &(regs)->outbound_intr_mask);

@@ -584,6 +592,7 @@ megasas_disable_intr_skinny(struct megasas_instance *instance)
{
	struct megasas_register_set __iomem *regs;
	u32 mask = 0xFFFFFFFF;

	regs = instance->reg_set;
	writel(mask, &regs->outbound_intr_mask);
	/* Dummy readl to force pci flush */
@@ -654,6 +663,7 @@ megasas_fire_cmd_skinny(struct megasas_instance *instance,
			struct megasas_register_set __iomem *regs)
{
	unsigned long flags;

	spin_lock_irqsave(&instance->hba_lock, flags);
	writel(upper_32_bits(frame_phys_addr),
	       &(regs)->inbound_high_queue_port);
@@ -706,6 +716,7 @@ static inline void
megasas_enable_intr_gen2(struct megasas_instance *instance)
{
	struct megasas_register_set __iomem *regs;

	regs = instance->reg_set;
	writel(0xFFFFFFFF, &(regs)->outbound_doorbell_clear);

@@ -725,6 +736,7 @@ megasas_disable_intr_gen2(struct megasas_instance *instance)
{
	struct megasas_register_set __iomem *regs;
	u32 mask = 0xFFFFFFFF;

	regs = instance->reg_set;
	writel(mask, &regs->outbound_intr_mask);
	/* Dummy readl to force pci flush */
@@ -750,6 +762,7 @@ megasas_clear_intr_gen2(struct megasas_register_set __iomem *regs)
{
	u32 status;
	u32 mfiStatus = 0;

	/*
	 * Check if it is our interrupt
	 */
@@ -786,6 +799,7 @@ megasas_fire_cmd_gen2(struct megasas_instance *instance,
			struct megasas_register_set __iomem *regs)
{
	unsigned long flags;

	spin_lock_irqsave(&instance->hba_lock, flags);
	writel((frame_phys_addr | (frame_count<<1))|1,
			&(regs)->inbound_queue_port);
@@ -839,7 +853,7 @@ megasas_adp_reset_gen2(struct megasas_instance *instance,
	ssleep(10);

	HostDiag = (u32)readl(hostdiag_offset);
	while ( ( HostDiag & DIAG_RESET_ADAPTER) ) {
	while (HostDiag & DIAG_RESET_ADAPTER) {
		msleep(100);
		HostDiag = (u32)readl(hostdiag_offset);
		dev_notice(&instance->pdev->dev, "RESET_GEN2: retry=%x, hostdiag=%x\n",
@@ -904,7 +918,6 @@ int
megasas_issue_polled(struct megasas_instance *instance, struct megasas_cmd *cmd)
{
	int seconds;

	struct megasas_header *frame_hdr = &cmd->frame->hdr;

	frame_hdr->cmd_status = MFI_CMD_STATUS_POLL_MODE;
@@ -940,6 +953,7 @@ megasas_issue_blocked_cmd(struct megasas_instance *instance,
			  struct megasas_cmd *cmd, int timeout)
{
	int ret = 0;

	cmd->cmd_status_drv = MFI_STAT_INVALID_STATUS;

	instance->instancet->issue_dcmd(instance, cmd);
@@ -1471,8 +1485,7 @@ megasas_dump_pending_frames(struct megasas_instance *instance)
			instance->host->host_no, cmd->frame_count, ldio->cmd, ldio->target_id,
			le32_to_cpu(ldio->start_lba_lo), le32_to_cpu(ldio->start_lba_hi),
			le32_to_cpu(ldio->sense_buf_phys_addr_lo), sgcount);
		}
		else {
		} else {
			pthru = (struct megasas_pthru_frame *) cmd->frame;
			mfi_sgl = &pthru->sgl;
			sgcount = pthru->sge_count;
@@ -1500,10 +1513,9 @@ megasas_dump_pending_frames(struct megasas_instance *instance)

		cmd = instance->cmd_list[i];

		if(cmd->sync_cmd == 1){
		if (cmd->sync_cmd == 1)
			dev_err(&instance->pdev->dev, "0x%08lx : ", (unsigned long)cmd->frame_phys_addr);
	}
	}
	dev_err(&instance->pdev->dev, "[%d]: Dumping Done\n\n",instance->host->host_no);
}

@@ -1662,6 +1674,7 @@ static int megasas_slave_alloc(struct scsi_device *sdev)
{
	u16 pd_index = 0;
	struct megasas_instance *instance ;

	instance = megasas_lookup_instance(sdev->host->host_no);
	if (sdev->channel < MEGASAS_MAX_PD_CHANNELS) {
		/*
@@ -1727,8 +1740,7 @@ void megaraid_sas_kill_hba(struct megasas_instance *instance)
		(instance->pdev->device == PCI_DEVICE_ID_LSI_PLASMA) ||
		(instance->pdev->device == PCI_DEVICE_ID_LSI_INVADER) ||
		(instance->pdev->device == PCI_DEVICE_ID_LSI_FURY)) {
		writel(MFI_STOP_ADP,
			&instance->reg_set->doorbell);
		writel(MFI_STOP_ADP, &instance->reg_set->doorbell);
		/* Flush */
		readl(&instance->reg_set->doorbell);
		if (instance->mpio && instance->requestorId)
@@ -2324,7 +2336,6 @@ static int megasas_wait_for_outstanding(struct megasas_instance *instance)
	}

	for (i = 0; i < resetwaittime; i++) {

		int outstanding = atomic_read(&instance->fw_outstanding);

		if (!outstanding)
@@ -2363,10 +2374,8 @@ static int megasas_wait_for_outstanding(struct megasas_instance *instance)
		i++;
	} while (i <= 3);

	if (atomic_read(&instance->fw_outstanding) &&
					!kill_adapter_flag) {
	if (atomic_read(&instance->fw_outstanding) && !kill_adapter_flag) {
		if (instance->disableOnlineCtrlReset == 0) {

			megasas_do_ocr(instance);

			/* wait for 5 secs to let FW finish the pending cmds */
@@ -2478,14 +2487,10 @@ blk_eh_timer_return megasas_reset_timer(struct scsi_cmnd *scmd)
 */
static int megasas_reset_device(struct scsi_cmnd *scmd)
{
	int ret;

	/*
	 * First wait for all commands to complete
	 */
	ret = megasas_generic_reset(scmd);

	return ret;
	return megasas_generic_reset(scmd);
}

/**
@@ -2495,6 +2500,7 @@ static int megasas_reset_bus_host(struct scsi_cmnd *scmd)
{
	int ret;
	struct megasas_instance *instance;

	instance = (struct megasas_instance *)scmd->device->host->hostdata;

	/*
@@ -2526,6 +2532,7 @@ megasas_bios_param(struct scsi_device *sdev, struct block_device *bdev,
	int sectors;
	sector_t cylinders;
	unsigned long tmp;

	/* Default heads (64) & sectors (32) */
	heads = 64;
	sectors = 32;
@@ -2572,6 +2579,7 @@ static void
megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd)
{
	unsigned long flags;

	/*
	 * Don't signal app if it is just an aborted previously registered aen
	 */
@@ -2592,6 +2600,7 @@ megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd)
	if ((instance->unload == 0) &&
		((instance->issuepend_done == 1))) {
		struct megasas_aen_event *ev;

		ev = kzalloc(sizeof(*ev), GFP_ATOMIC);
		if (!ev) {
			dev_err(&instance->pdev->dev, "megasas_service_aen: out of memory\n");
@@ -2651,8 +2660,7 @@ megasas_fw_crash_buffer_show(struct device *cdev,

	buff_addr = (unsigned long) buf;

	if (buff_offset >
		(instance->fw_crash_buffer_size * dmachunk)) {
	if (buff_offset > (instance->fw_crash_buffer_size * dmachunk)) {
		dev_err(&instance->pdev->dev,
			"Firmware crash dump offset is out of range\n");
		spin_unlock_irqrestore(&instance->crashdump_lock, flags);
@@ -2724,6 +2732,7 @@ megasas_fw_crash_state_show(struct device *cdev,
	struct Scsi_Host *shost = class_to_shost(cdev);
	struct megasas_instance *instance =
		(struct megasas_instance *) shost->hostdata;

	return snprintf(buf, PAGE_SIZE, "%d\n", instance->fw_crash_state);
}

@@ -2808,8 +2817,6 @@ megasas_complete_abort(struct megasas_instance *instance,
		cmd->cmd_status_drv = 0;
		wake_up(&instance->abort_cmd_wait_q);
	}

	return;
}

/**
@@ -3163,7 +3170,7 @@ process_fw_state_change_wq(struct work_struct *work)
		dev_notice(&instance->pdev->dev, "HBA recovery state machine,"
					"state 2 starting...\n");

		/*waitting for about 20 second before start the second init*/
		/* waiting for about 20 second before start the second init */
		for (wait = 0; wait < 30; wait++) {
			msleep(1000);
		}
@@ -3196,7 +3203,6 @@ process_fw_state_change_wq(struct work_struct *work)
		megasas_issue_pending_cmds_again(instance);
		instance->issuepend_done = 1;
	}
	return ;
}

/**
@@ -3566,9 +3572,8 @@ static int megasas_create_frame_pool(struct megasas_instance *instance)
	sge_sz = (IS_DMA64) ? sizeof(struct megasas_sge64) :
	    sizeof(struct megasas_sge32);

	if (instance->flag_ieee) {
	if (instance->flag_ieee)
		sge_sz = sizeof(struct megasas_sge_skinny);
	}

	/*
	 * For MFI controllers.
@@ -3652,6 +3657,7 @@ static int megasas_create_frame_pool(struct megasas_instance *instance)
void megasas_free_cmds(struct megasas_instance *instance)
{
	int i;

	/* First free the MFI frame pool */
	megasas_teardown_frame_pool(instance);

@@ -4063,7 +4069,6 @@ static void megasas_update_ext_vd_details(struct megasas_instance *instance)
		fusion->current_map_sz = new_map_sz;
	else
		fusion->current_map_sz = old_map_sz;

}

/**
@@ -4210,9 +4215,7 @@ static int
megasas_issue_init_mfi(struct megasas_instance *instance)
{
	__le32 context;

	struct megasas_cmd *cmd;

	struct megasas_init_frame *init_frame;
	struct megasas_init_queue_info *initq_info;
	dma_addr_t init_frame_h;
@@ -4653,7 +4656,6 @@ static int megasas_init_fw(struct megasas_instance *instance)
	/** for passthrough
	 * the following function will get the PD LIST.
	 */

	memset(instance->pd_list, 0,
		(MEGASAS_MAX_PD * sizeof(struct megasas_pd_list)));
	if (megasas_get_pd_list(instance) < 0) {
@@ -5122,7 +5124,7 @@ static int
megasas_set_dma_mask(struct pci_dev *pdev)
{
	/*
	 * All our contollers are capable of performing 64-bit DMA
	 * All our controllers are capable of performing 64-bit DMA
	 */
	if (IS_DMA64) {
		if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0) {
@@ -5481,8 +5483,6 @@ static void megasas_flush_cache(struct megasas_instance *instance)
			" from %s\n", __func__);

	megasas_return_cmd(instance, cmd);

	return;
}

/**
@@ -5528,8 +5528,6 @@ static void megasas_shutdown_controller(struct megasas_instance *instance,
			"from %s\n", __func__);

	megasas_return_cmd(instance, cmd);

	return;
}

#ifdef CONFIG_PM
@@ -5835,8 +5833,6 @@ static void megasas_detach_one(struct pci_dev *pdev)
	scsi_host_put(host);

	pci_disable_device(pdev);

	return;
}

/**
@@ -5905,11 +5901,11 @@ static unsigned int megasas_mgmt_poll(struct file *file, poll_table *wait)
{
	unsigned int mask;
	unsigned long flags;

	poll_wait(file, &megasas_poll_wait, wait);
	spin_lock_irqsave(&poll_aen_lock, flags);
	if (megasas_poll_wait_aen)
		mask = (POLLIN | POLLRDNORM);

	else
		mask = 0;
	megasas_poll_wait_aen = 0;
@@ -5923,8 +5919,7 @@ static unsigned int megasas_mgmt_poll(struct file *file, poll_table *wait)
 * @cmd:	MFI command frame
 */

static int megasas_set_crash_dump_params_ioctl(
	struct megasas_cmd *cmd)
static int megasas_set_crash_dump_params_ioctl(struct megasas_cmd *cmd)
{
	struct megasas_instance *local_instance;
	int i, error = 0;
@@ -6458,6 +6453,7 @@ static ssize_t
megasas_sysfs_set_dbg_lvl(struct device_driver *dd, const char *buf, size_t count)
{
	int retval = count;

	if (sscanf(buf, "%u", &megasas_dbg_lvl) < 1) {
		printk(KERN_ERR "megasas: could not set dbg_lvl\n");
		retval = -EINVAL;
@@ -6520,14 +6516,12 @@ megasas_aen_polling(struct work_struct *work)
				pd_index =
				(i * MEGASAS_MAX_DEV_PER_CHANNEL) + j;

				sdev1 =
				scsi_device_lookup(host, i, j, 0);
				sdev1 = scsi_device_lookup(host, i, j, 0);

				if (instance->pd_list[pd_index].driveState
						== MR_PD_STATE_SYSTEM) {
						if (!sdev1) {
					if (!sdev1)
						scsi_add_device(host, i, j, 0);
						}

					if (sdev1)
						scsi_device_put(sdev1);
@@ -6548,14 +6542,12 @@ megasas_aen_polling(struct work_struct *work)
				pd_index =
				(i * MEGASAS_MAX_DEV_PER_CHANNEL) + j;

				sdev1 =
				scsi_device_lookup(host, i, j, 0);
				sdev1 = scsi_device_lookup(host, i, j, 0);

				if (instance->pd_list[pd_index].driveState
					== MR_PD_STATE_SYSTEM) {
					if (sdev1) {
					if (sdev1)
						scsi_device_put(sdev1);
					}
				} else {
					if (sdev1) {
						scsi_remove_device(sdev1);