fab0c58f8a7625be30f60ddeecd5d93c20e87216
[firefly-linux-kernel-4.4.55.git] / drivers / staging / unisys / include / commontypes.h
1 /* Copyright (C) 2010 - 2013 UNISYS CORPORATION
2  * All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or (at
7  * your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
12  * NON INFRINGEMENT.  See the GNU General Public License for more
13  * details.
14  */
15
16 #ifndef _COMMONTYPES_H_
17 #define _COMMONTYPES_H_
18
19 /* define the following to prevent include nesting in kernel header files of
20  * similar abbreviated content */
21 #define _SUPERVISOR_COMMONTYPES_H_
22
23 #include <linux/types.h>
24 #include <linux/version.h>
25 #include <linux/io.h>
26 #include <linux/uuid.h>
27
28 #define OFFSETOF offsetof
29
30 #define CHANNEL_GUID_MISMATCH(chType, chName, field, expected, actual, fil, \
31                               lin, logCtx)                              \
32         do {                                                            \
33                 pr_err("Channel mismatch on channel=%s(%pUL) field=%s expected=%pUL actual=%pUL @%s:%d\n", \
34                        chName, &chType, field,  \
35                        &expected, &actual, \
36                        fil, lin);                                       \
37         } while (0)
38 #define CHANNEL_U32_MISMATCH(chType, chName, field, expected, actual, fil, \
39                              lin, logCtx)                               \
40         do {                                                            \
41                 pr_err("Channel mismatch on channel=%s(%pUL) field=%s expected=0x%-8.8lx actual=0x%-8.8lx @%s:%d\n", \
42                        chName, &chType, field,  \
43                        (unsigned long)expected, (unsigned long)actual,  \
44                        fil, lin);                                       \
45         } while (0)
46
47 #define CHANNEL_U64_MISMATCH(chType, chName, field, expected, actual, fil, \
48                              lin, logCtx)                               \
49         do {                                                            \
50                 pr_err("Channel mismatch on channel=%s(%pUL) field=%s expected=0x%-8.8Lx actual=0x%-8.8Lx @%s:%d\n", \
51                        chName, &chType, field,  \
52                        (unsigned long long)expected,                    \
53                        (unsigned long long)actual,                      \
54                        fil, lin);                                       \
55         } while (0)
56
57 #define UltraLogEvent(logCtx, EventId, Severity, SubsystemMask, pFunctionName, \
58                       LineNumber, Str, args...)                         \
59         pr_info(Str, ## args)
60
61 #endif
62