staging: unisys: Fix VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS
authorBenjamin Romer <benjamin.romer@unisys.com>
Fri, 3 Oct 2014 18:09:17 +0000 (14:09 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Oct 2014 02:29:06 +0000 (10:29 +0800)
Get rid of the typedef for VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS, and
use the name struct vmcall_channel_version_mismatch_params instead. Fix
CamelCase member names:

ChannelName => chname
ItemName => item_name
SourceFileName => file_name
SourceLineNumber => line_no

And get rid of the lengthof macro in issue_vmcall_channel_mismatch().

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/common-spar/include/vmcallinterface.h
drivers/staging/unisys/include/uisutils.h

index c9dc51896287dde3eb62a4fa1432c947a5091a96..7750086e5bb3a96af49fead473af80fa7a1b9802 100644 (file)
@@ -154,14 +154,14 @@ struct vmcall_io_visorserial_addr_params {
 /* ///////////// END PRAGMA PACK PUSH 1 /////////////////////////// */
 
 /* Parameters to VMCALL_CHANNEL_MISMATCH interface */
-typedef struct _VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS {
-       u8 ChannelName[32];     /* Null terminated string giving name of channel
+struct vmcall_channel_version_mismatch_params {
+       u8 chname[32];  /* Null terminated string giving name of channel
                                 * (IN) */
-       u8 ItemName[32];        /* Null terminated string giving name of
+       u8 item_name[32];       /* Null terminated string giving name of
                                 * mismatched item (IN) */
-       u32 SourceLineNumber;   /* line# where invoked. (IN) */
-       u8 SourceFileName[36];  /* source code where invoked - Null terminated
+       u32 line_no;            /* line# where invoked. (IN) */
+       u8 file_name[36];       /* source code where invoked - Null terminated
                                 * string (IN) */
-} VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS;
+};
 
 #endif /* __IOMONINTF_H__ */
index cf9423e46c4888b0afc06cd2c81e6013b522ba5a..5f249dc55c680ba587e95d5fa5ec55c4fa5ba748 100644 (file)
@@ -298,28 +298,23 @@ static inline unsigned int issue_vmcall_channel_mismatch(const char *chname,
                              const char *item_name, u32 line_no,
                              const char *path_n_fn)
 {
-       VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS params;
+       struct vmcall_channel_version_mismatch_params params;
        int result = VMCALL_SUCCESS;
        u64 physaddr;
        char *last_slash = NULL;
 
-       strlcpy(params.ChannelName, chname,
-               lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS, ChannelName));
-       strlcpy(params.ItemName, item_name,
-               lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS, ItemName));
-       params.SourceLineNumber = line_no;
+       strlcpy(params.chname, chname, sizeof(params.chname));
+       strlcpy(params.item_name, item_name, sizeof(params.item_name));
+       params.line_no = line_no;
 
        last_slash = strrchr(path_n_fn, '/');
        if (last_slash != NULL) {
                last_slash++;
-               strlcpy(params.SourceFileName, last_slash,
-                       lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS,
-                                SourceFileName));
+               strlcpy(params.file_name, last_slash, sizeof(params.file_name));
        } else
-               strlcpy(params.SourceFileName,
+               strlcpy(params.file_name,
                        "Cannot determine source filename",
-                       lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS,
-                                SourceFileName));
+                       sizeof(params.file_name));
 
        physaddr = virt_to_phys(&params);
        ISSUE_IO_VMCALL(VMCALL_CHANNEL_VERSION_MISMATCH, physaddr, result);