Commit a09ad889 authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: Fix VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS

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: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3301335f
...@@ -154,14 +154,14 @@ struct vmcall_io_visorserial_addr_params { ...@@ -154,14 +154,14 @@ struct vmcall_io_visorserial_addr_params {
/* ///////////// END PRAGMA PACK PUSH 1 /////////////////////////// */ /* ///////////// END PRAGMA PACK PUSH 1 /////////////////////////// */
/* Parameters to VMCALL_CHANNEL_MISMATCH interface */ /* Parameters to VMCALL_CHANNEL_MISMATCH interface */
typedef struct _VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS { struct vmcall_channel_version_mismatch_params {
u8 ChannelName[32]; /* Null terminated string giving name of channel u8 chname[32]; /* Null terminated string giving name of channel
* (IN) */ * (IN) */
u8 ItemName[32]; /* Null terminated string giving name of u8 item_name[32]; /* Null terminated string giving name of
* mismatched item (IN) */ * mismatched item (IN) */
u32 SourceLineNumber; /* line# where invoked. (IN) */ u32 line_no; /* line# where invoked. (IN) */
u8 SourceFileName[36]; /* source code where invoked - Null terminated u8 file_name[36]; /* source code where invoked - Null terminated
* string (IN) */ * string (IN) */
} VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS; };
#endif /* __IOMONINTF_H__ */ #endif /* __IOMONINTF_H__ */
...@@ -298,28 +298,23 @@ static inline unsigned int issue_vmcall_channel_mismatch(const char *chname, ...@@ -298,28 +298,23 @@ static inline unsigned int issue_vmcall_channel_mismatch(const char *chname,
const char *item_name, u32 line_no, const char *item_name, u32 line_no,
const char *path_n_fn) const char *path_n_fn)
{ {
VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS params; struct vmcall_channel_version_mismatch_params params;
int result = VMCALL_SUCCESS; int result = VMCALL_SUCCESS;
u64 physaddr; u64 physaddr;
char *last_slash = NULL; char *last_slash = NULL;
strlcpy(params.ChannelName, chname, strlcpy(params.chname, chname, sizeof(params.chname));
lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS, ChannelName)); strlcpy(params.item_name, item_name, sizeof(params.item_name));
strlcpy(params.ItemName, item_name, params.line_no = line_no;
lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS, ItemName));
params.SourceLineNumber = line_no;
last_slash = strrchr(path_n_fn, '/'); last_slash = strrchr(path_n_fn, '/');
if (last_slash != NULL) { if (last_slash != NULL) {
last_slash++; last_slash++;
strlcpy(params.SourceFileName, last_slash, strlcpy(params.file_name, last_slash, sizeof(params.file_name));
lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS,
SourceFileName));
} else } else
strlcpy(params.SourceFileName, strlcpy(params.file_name,
"Cannot determine source filename", "Cannot determine source filename",
lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS, sizeof(params.file_name));
SourceFileName));
physaddr = virt_to_phys(&params); physaddr = virt_to_phys(&params);
ISSUE_IO_VMCALL(VMCALL_CHANNEL_VERSION_MISMATCH, physaddr, result); ISSUE_IO_VMCALL(VMCALL_CHANNEL_VERSION_MISMATCH, physaddr, result);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment