summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorBryan Thompson <bryan.thompson@unisys.com>2016-12-01 09:31:05 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-12-01 11:58:48 +0300
commitc7e047768b8cac22398b0dc5e572e3482f07006b (patch)
treef3b16e0b8eb6643d9cd84821bd70a93090fa5ef2 /drivers/staging
parent22744c96c7a4c41e6fd60058b165965d58b24cbc (diff)
downloadlinux-c7e047768b8cac22398b0dc5e572e3482f07006b.tar.xz
staging: unisys: visorbus: Replace two base postcode macros with one
Leverage the 3 existing s-Par postcode macros to do a bit more work and provide only 1 base postcode macro. Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/unisys/visorbus/vmcallinterface.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/staging/unisys/visorbus/vmcallinterface.h b/drivers/staging/unisys/visorbus/vmcallinterface.h
index a8f6f6ca7662..ab44402ca422 100644
--- a/drivers/staging/unisys/visorbus/vmcallinterface.h
+++ b/drivers/staging/unisys/visorbus/vmcallinterface.h
@@ -227,7 +227,13 @@ enum event_pc { /* POSTCODE event identifier tuples */
/* TODO-> Info currently doesn't show, so we set info=warning */
#define POSTCODE_SEVERITY_INFO DIAG_SEVERITY_PRINT
-/* example call of POSTCODE_LINUX_2(VISOR_CHIPSET_PC, POSTCODE_SEVERITY_ERR);
+/* Write a 64-bit value to the hypervisor's log file
+ * POSTCODE_LINUX generates a value in the form 0xAABBBCCCDDDDEEEE where
+ * A is an identifier for the file logging the postcode
+ * B is an identifier for the event logging the postcode
+ * C is the line logging the postcode
+ * D is additional information the caller wants to log
+ * E is additional information the caller wants to log
* Please also note that the resulting postcode is in hex, so if you are
* searching for the __LINE__ number, convert it first to decimal. The line
* number combined with driver and type of call, will allow you to track down
@@ -236,16 +242,7 @@ enum event_pc { /* POSTCODE event identifier tuples */
*/
/* BASE FUNCTIONS */
-#define POSTCODE_LINUX_A(DRIVER_PC, EVENT_PC, pc32bit, severity) \
-do { \
- unsigned long long post_code_temp; \
- post_code_temp = (((u64)DRIVER_PC) << 56) | (((u64)EVENT_PC) << 44) | \
- ((((u64)__LINE__) & 0xFFF) << 32) | \
- (((u64)pc32bit) & 0xFFFFFFFF); \
- ISSUE_IO_VMCALL_POSTCODE_SEVERITY(post_code_temp, severity); \
-} while (0)
-
-#define POSTCODE_LINUX_B(DRIVER_PC, EVENT_PC, pc16bit1, pc16bit2, severity) \
+#define POSTCODE_LINUX(DRIVER_PC, EVENT_PC, pc16bit1, pc16bit2, severity) \
do { \
unsigned long long post_code_temp; \
post_code_temp = (((u64)DRIVER_PC) << 56) | (((u64)EVENT_PC) << 44) | \
@@ -257,13 +254,14 @@ do { \
/* MOST COMMON */
#define POSTCODE_LINUX_2(EVENT_PC, severity) \
- POSTCODE_LINUX_A(CURRENT_FILE_PC, EVENT_PC, 0x0000, severity)
+ POSTCODE_LINUX(CURRENT_FILE_PC, EVENT_PC, 0, 0, severity)
#define POSTCODE_LINUX_3(EVENT_PC, pc32bit, severity) \
- POSTCODE_LINUX_A(CURRENT_FILE_PC, EVENT_PC, pc32bit, severity)
+ POSTCODE_LINUX(CURRENT_FILE_PC, EVENT_PC, (pc32bit >> 16), \
+ (pc32bit & 0xFFFF), severity)
#define POSTCODE_LINUX_4(EVENT_PC, pc16bit1, pc16bit2, severity) \
- POSTCODE_LINUX_B(CURRENT_FILE_PC, EVENT_PC, pc16bit1, \
+ POSTCODE_LINUX(CURRENT_FILE_PC, EVENT_PC, pc16bit1, \
pc16bit2, severity)
#endif /* __IOMONINTF_H__ */