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@xxxxxxxxxx> --- .../unisys/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 c9dc518..7750086 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 cf9423e..5f249dc 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); -- 1.9.1 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel