[PATCH v2 14/46] staging: unisys: visorbus: merging the visorbus_device_pause_response and visorbus_device_resume_response functions into one.

David Kershner david.kershner at unisys.com
Tue Aug 22 17:27:04 UTC 2017


From: Sameer Wadgaonkar <sameer.wadgaonkar at unisys.com>

The functions viosrbus_device_pause_response() and
viosrbus_device_resume_response() are functionally similar.
Merging these functions into a single function called
visorbus_device_changestate_response().

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar at unisys.com>
Signed-off-by: David Kershner <david.kershner at unisys.com>
Reviewed-by: Tim Sell <timothy.sell at unisys.com>
---
 drivers/staging/unisys/visorbus/visorbus_main.c    |  6 +++--
 drivers/staging/unisys/visorbus/visorbus_private.h |  4 +--
 drivers/staging/unisys/visorbus/visorchipset.c     | 19 +++------------
 3 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index 93db8d3..8e8abac 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -1170,7 +1170,8 @@ static void pause_state_change_complete(struct visor_device *dev, int status)
 		return;
 
 	dev->pausing = false;
-	visorbus_device_pause_response(dev, status);
+	visorbus_device_changestate_response(dev, status,
+					     segment_state_standby);
 }
 
 /*
@@ -1194,7 +1195,8 @@ static void resume_state_change_complete(struct visor_device *dev, int status)
 	 * which will presumably want to send some sort of response to
 	 * the initiator.
 	 */
-	visorbus_device_resume_response(dev, status);
+	visorbus_device_changestate_response(dev, status,
+					     segment_state_running);
 }
 
 /*
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h b/drivers/staging/unisys/visorbus/visorbus_private.h
index fed7e62..6af9f7c 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -30,8 +30,8 @@ int visorchipset_device_pause(struct visor_device *dev_info);
 int visorchipset_device_resume(struct visor_device *dev_info);
 
 void visorbus_response(struct visor_device *p, int response, int controlvm_id);
-void visorbus_device_resume_response(struct visor_device *p, int response);
-void visorbus_device_pause_response(struct visor_device *p, int response);
+void visorbus_device_changestate_response(struct visor_device *p, int response,
+					  struct visor_segment_state state);
 
 int visorbus_init(void);
 void visorbus_exit(void);
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index a203c19..bfaf17e 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1455,23 +1455,12 @@ void visorbus_response(struct visor_device *bus_info, int response,
 	bus_info->pending_msg_hdr = NULL;
 }
 
-void visorbus_device_pause_response(struct visor_device *dev_info,
-				    int response)
-{
-	device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
-				     dev_info, response,
-				     segment_state_standby);
-
-	kfree(dev_info->pending_msg_hdr);
-	dev_info->pending_msg_hdr = NULL;
-}
-
-void visorbus_device_resume_response(struct visor_device *dev_info,
-				     int response)
+void visorbus_device_changestate_response(struct visor_device *dev_info,
+					  int response,
+					  struct visor_segment_state state)
 {
 	device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
-				     dev_info, response,
-				     segment_state_running);
+				     dev_info, response, state);
 
 	kfree(dev_info->pending_msg_hdr);
 	dev_info->pending_msg_hdr = NULL;
-- 
git-series 0.9.1


More information about the devel mailing list