All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 2/2] megaraid_sas: remove unused variables
@ 2014-03-05  6:37 Minemoto, Shintaro
  0 siblings, 0 replies; 2+ messages in thread
From: Minemoto, Shintaro @ 2014-03-05  6:37 UTC (permalink / raw)
  To: linux-scsi, thenzl
  Cc: sumit.saxena, aradford, Tokunaga, Keiichirou, Ishii, Hideyuki,
	Minemoto, Shintaro

Hi Tomas,

> Some, almost not used variables removed.

I reviewed your patch and it looks good to me.

Reviewed-by: Shintaro Minemoto <fj3207hq@aa.jp.fujitsu.com>

# I'm not in scsi-linux mailing list.  Please cc me when you reply.

Thanks,
Shintaro Minemoto


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 2/2] megaraid_sas: remove unused variables
  2014-02-28 14:54 [PATCH 0/2] megaraid_sas: fix a small problem when reading state value from hw Tomas Henzl
@ 2014-02-28 14:54 ` Tomas Henzl
  0 siblings, 0 replies; 2+ messages in thread
From: Tomas Henzl @ 2014-02-28 14:54 UTC (permalink / raw)
  To: linux-scsi; +Cc: jbottomley, Tomas Henzl, Sumit Saxena, Adam Radford

Some, almost not used variables removed.

Cc: Sumit Saxena <sumit.saxena@lsi.com>
Cc: Adam Radford <aradford@gmail.com>
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 53 +++++++------------------------
 1 file changed, 11 insertions(+), 42 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 1153ac4..806ac60 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -2621,10 +2621,7 @@ int
 megasas_transition_to_ready(struct megasas_instance *instance, int ocr)
 {
 	int i;
-	u8 max_wait;
-	u32 fw_state;
-	u32 cur_state;
-	u32 abs_state, curr_abs_state;
+	u32 fw_state, abs_state, curr_abs_state;
 
 	abs_state = instance->instancet->read_fw_status_reg(instance->reg_set);
 	fw_state = abs_state & MFI_STATE_MASK;
@@ -2639,11 +2636,9 @@ megasas_transition_to_ready(struct megasas_instance *instance, int ocr)
 
 		case MFI_STATE_FAULT:
 			printk(KERN_DEBUG "megasas: FW in FAULT state!!\n");
-			if (ocr) {
-				max_wait = MEGASAS_RESET_WAIT_TIME;
-				cur_state = MFI_STATE_FAULT;
+			if (ocr)
 				break;
-			} else
+			else
 				return -ENODEV;
 
 		case MFI_STATE_WAIT_HANDSHAKE:
@@ -2667,8 +2662,6 @@ megasas_transition_to_ready(struct megasas_instance *instance, int ocr)
 					&instance->reg_set->inbound_doorbell);
 			}
 
-			max_wait = MEGASAS_RESET_WAIT_TIME;
-			cur_state = MFI_STATE_WAIT_HANDSHAKE;
 			break;
 
 		case MFI_STATE_BOOT_MESSAGE_PENDING:
@@ -2686,8 +2679,6 @@ megasas_transition_to_ready(struct megasas_instance *instance, int ocr)
 				writel(MFI_INIT_HOTPLUG,
 					&instance->reg_set->inbound_doorbell);
 
-			max_wait = MEGASAS_RESET_WAIT_TIME;
-			cur_state = MFI_STATE_BOOT_MESSAGE_PENDING;
 			break;
 
 		case MFI_STATE_OPERATIONAL:
@@ -2723,41 +2714,17 @@ megasas_transition_to_ready(struct megasas_instance *instance, int ocr)
 				writel(MFI_RESET_FLAGS,
 					&instance->reg_set->inbound_doorbell);
 
-			max_wait = MEGASAS_RESET_WAIT_TIME;
-			cur_state = MFI_STATE_OPERATIONAL;
 			break;
 
 		case MFI_STATE_UNDEFINED:
 			/*
 			 * This state should not last for more than 2 seconds
 			 */
-			max_wait = MEGASAS_RESET_WAIT_TIME;
-			cur_state = MFI_STATE_UNDEFINED;
-			break;
-
 		case MFI_STATE_BB_INIT:
-			max_wait = MEGASAS_RESET_WAIT_TIME;
-			cur_state = MFI_STATE_BB_INIT;
-			break;
-
 		case MFI_STATE_FW_INIT:
-			max_wait = MEGASAS_RESET_WAIT_TIME;
-			cur_state = MFI_STATE_FW_INIT;
-			break;
-
 		case MFI_STATE_FW_INIT_2:
-			max_wait = MEGASAS_RESET_WAIT_TIME;
-			cur_state = MFI_STATE_FW_INIT_2;
-			break;
-
 		case MFI_STATE_DEVICE_SCAN:
-			max_wait = MEGASAS_RESET_WAIT_TIME;
-			cur_state = MFI_STATE_DEVICE_SCAN;
-			break;
-
 		case MFI_STATE_FLUSH_CACHE:
-			max_wait = MEGASAS_RESET_WAIT_TIME;
-			cur_state = MFI_STATE_FLUSH_CACHE;
 			break;
 
 		default:
@@ -2767,24 +2734,26 @@ megasas_transition_to_ready(struct megasas_instance *instance, int ocr)
 		}
 
 		/*
-		 * The cur_state should not last for more than max_wait secs
+		 * The cur_abs_state should not last for more than
+		 * MEGASAS_RESET_WAIT_TIME secs
 		 */
-		for (i = 0; i < (max_wait * 1000); i++) {
+		for (i = 0; i < (MEGASAS_RESET_WAIT_TIME * 1000); i++) {
 			curr_abs_state = instance->instancet->
 				read_fw_status_reg(instance->reg_set);
 
-			if (abs_state == curr_abs_state) {
+			if (abs_state == curr_abs_state)
 				msleep(1);
-			} else
+			else
 				break;
 		}
 
 		/*
-		 * Return error if fw_state hasn't changed after max_wait
+		 * Return error if fw_state hasn't changed
+		 * after MEGASAS_RESET_WAIT_TIME
 		 */
 		if (curr_abs_state == abs_state) {
 			printk(KERN_DEBUG "FW state [%d] hasn't changed "
-			       "in %d secs\n", fw_state, max_wait);
+			       "in %d secs\n", fw_state, MEGASAS_RESET_WAIT_TIME);
 			return -ENODEV;
 		}
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-05  6:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-05  6:37 [PATCH 2/2] megaraid_sas: remove unused variables Minemoto, Shintaro
  -- strict thread matches above, loose matches on Subject: below --
2014-02-28 14:54 [PATCH 0/2] megaraid_sas: fix a small problem when reading state value from hw Tomas Henzl
2014-02-28 14:54 ` [PATCH 2/2] megaraid_sas: remove unused variables Tomas Henzl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.