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 {
/* ///////////// 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__ */
......@@ -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);
......
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