staging: unisys: remove client from spar_check_channel
authorDavid Kershner <david.kershner@unisys.com>
Tue, 28 Mar 2017 13:34:42 +0000 (09:34 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Mar 2017 07:17:03 +0000 (09:17 +0200)
We only have one version of spar_check_channel, get rid of the client
at the end and help save space.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/include/channel.h
drivers/staging/unisys/include/iochannel.h
drivers/staging/unisys/visorbus/controlvmchannel.h
drivers/staging/unisys/visorbus/visorbus_main.c

index 71defbd9d3ce5558ee8a308c5fb8576d0d40c7fc..057421eeb1ae5ad230409f660d96df5608f96ca8 100644 (file)
@@ -204,12 +204,12 @@ struct signal_queue_header {
  * is used to pass the EFI_DIAG_CAPTURE_PROTOCOL needed to log messages.
  */
 static inline int
-spar_check_channel_client(struct channel_header *ch,
-                         uuid_le expected_uuid,
-                         char *chname,
-                         u64 expected_min_bytes,
-                         u32 expected_version,
-                         u64 expected_signature)
+spar_check_channel(struct channel_header *ch,
+                  uuid_le expected_uuid,
+                  char *chname,
+                  u64 expected_min_bytes,
+                  u32 expected_version,
+                  u64 expected_signature)
 {
        if (uuid_le_cmp(expected_uuid, NULL_UUID_LE) != 0) {
                /* caller wants us to verify type GUID */
index 5d8a500550f666c951ddc3971b8538638ad91b56..9bde848a321cd7121bec54c099a896e943d918ee 100644 (file)
 #define ULTRA_VSWITCH_CHANNEL_PROTOCOL_VERSIONID 1
 
 #define SPAR_VHBA_CHANNEL_OK_CLIENT(ch) \
-       (spar_check_channel_client(ch, spar_vhba_channel_protocol_uuid, \
-                                  "vhba", MIN_IO_CHANNEL_SIZE, \
-                                  ULTRA_VHBA_CHANNEL_PROTOCOL_VERSIONID, \
-                                  ULTRA_VHBA_CHANNEL_PROTOCOL_SIGNATURE))
+       (spar_check_channel(ch, spar_vhba_channel_protocol_uuid, \
+                           "vhba", MIN_IO_CHANNEL_SIZE,        \
+                           ULTRA_VHBA_CHANNEL_PROTOCOL_VERSIONID, \
+                           ULTRA_VHBA_CHANNEL_PROTOCOL_SIGNATURE))
 
 #define SPAR_VNIC_CHANNEL_OK_CLIENT(ch) \
-       (spar_check_channel_client(ch, spar_vnic_channel_protocol_uuid, \
-                                  "vnic", MIN_IO_CHANNEL_SIZE, \
-                                  ULTRA_VNIC_CHANNEL_PROTOCOL_VERSIONID, \
-                                  ULTRA_VNIC_CHANNEL_PROTOCOL_SIGNATURE))
+       (spar_check_channel(ch, spar_vnic_channel_protocol_uuid, \
+                           "vnic", MIN_IO_CHANNEL_SIZE,        \
+                           ULTRA_VNIC_CHANNEL_PROTOCOL_VERSIONID, \
+                           ULTRA_VNIC_CHANNEL_PROTOCOL_SIGNATURE))
 
 /*
  * Everything necessary to handle SCSI & NIC traffic between Guest Partition and
index e66d1540dfe2a63d084b519cd62fe5da6851263f..274f72422166202931dfa1a2a6c8243830eb4212 100644 (file)
 #define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID 1
 
 #define SPAR_CONTROLVM_CHANNEL_OK_CLIENT(ch) \
-       (spar_check_channel_client(ch, \
-               SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID, \
-               "controlvm", \
-               sizeof(struct spar_controlvm_channel_protocol), \
-               ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID, \
-               ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE))
+       (spar_check_channel(ch, \
+                           SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID, \
+                           "controlvm", \
+                           sizeof(struct spar_controlvm_channel_protocol), \
+                           ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID, \
+                           ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE))
 
 /* Defines for various channel queues */
 #define CONTROLVM_QUEUE_REQUEST         0
index 8b434b0d73b88e8e6f9bfa73e19435cfe4641ef2..6f3bbe55f4163afcb2db70c831f205757174cf0f 100644 (file)
@@ -699,13 +699,12 @@ static int
 get_vbus_header_info(struct visorchannel *chan,
                     struct spar_vbus_headerinfo *hdr_info)
 {
-       if (!spar_check_channel_client(visorchannel_get_header(chan),
-                                      spar_vbus_channel_protocol_uuid,
-                                      "vbus",
-                                      sizeof
-                                           (struct spar_vbus_channel_protocol),
-                                      SPAR_VBUS_CHANNEL_PROTOCOL_VERSIONID,
-                                      SPAR_VBUS_CHANNEL_PROTOCOL_SIGNATURE))
+       if (!spar_check_channel(visorchannel_get_header(chan),
+                               spar_vbus_channel_protocol_uuid,
+                               "vbus",
+                               sizeof(struct spar_vbus_channel_protocol),
+                               SPAR_VBUS_CHANNEL_PROTOCOL_VERSIONID,
+                               SPAR_VBUS_CHANNEL_PROTOCOL_SIGNATURE))
                return -EINVAL;
 
        if (visorchannel_read(chan, sizeof(struct channel_header), hdr_info,