staging: unisys: visorbus: merging the visorbus_device_pause_response and visorbus_de...
authorSameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Tue, 22 Aug 2017 17:27:04 +0000 (13:27 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Aug 2017 21:56:04 +0000 (14:56 -0700)
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@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorbus/visorbus_main.c
drivers/staging/unisys/visorbus/visorbus_private.h
drivers/staging/unisys/visorbus/visorchipset.c

index 93db8d32f7ef6dfc5e907c12b9d4ed773573c722..8e8abac841bb9ed22284e156187ac599a6b8d3ca 100644 (file)
@@ -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);
 }
 
 /*
index fed7e623318957b24705535b05092e9ec94ae0ab..6af9f7cc9c654ae7d37e488a68255b88d8707232 100644 (file)
@@ -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);
index a203c19048ea65000cf199a2d6f2f36f2e889543..bfaf17effb2b0004779e262ea26fc58b4a0041de 100644 (file)
@@ -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;