From a09ad889f5805e77ec1b42508d5706666304b44a Mon Sep 17 00:00:00 2001 From: Benjamin Romer Date: Fri, 3 Oct 2014 14:09:17 -0400 Subject: [PATCH] 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: Benjamin Romer Signed-off-by: Greg Kroah-Hartman --- .../common-spar/include/vmcallinterface.h | 12 ++++++------ drivers/staging/unisys/include/uisutils.h | 19 +++++++------------ 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/drivers/staging/unisys/common-spar/include/vmcallinterface.h b/drivers/staging/unisys/common-spar/include/vmcallinterface.h index c9dc51896287..7750086e5bb3 100644 --- a/drivers/staging/unisys/common-spar/include/vmcallinterface.h +++ b/drivers/staging/unisys/common-spar/include/vmcallinterface.h @@ -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__ */ diff --git a/drivers/staging/unisys/include/uisutils.h b/drivers/staging/unisys/include/uisutils.h index cf9423e46c48..5f249dc55c68 100644 --- a/drivers/staging/unisys/include/uisutils.h +++ b/drivers/staging/unisys/include/uisutils.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(¶ms); ISSUE_IO_VMCALL(VMCALL_CHANNEL_VERSION_MISMATCH, physaddr, result); -- 2.39.2