Skip to content

Commit 061c996

Browse files
masahir0yheicarst
authored andcommitted
s390: use __u{16,32,64} instead of uint{16,32,64}_t in uapi header
When CONFIG_UAPI_HEADER_TEST=y, exported headers are compile-tested to make sure they can be included from user-space. Currently, zcrypt.h is excluded from the test coverage. To make it join the compile-test, we need to fix the build errors attached below. For a case like this, we decided to use __u{8,16,32,64} variable types in this discussion: https://lkml.org/lkml/2019/6/5/18 Build log: CC usr/include/asm/zcrypt.h.s In file included from <command-line>:32:0: ./usr/include/asm/zcrypt.h:163:2: error: unknown type name ‘uint16_t’ uint16_t cprb_len; ^~~~~~~~ ./usr/include/asm/zcrypt.h:168:2: error: unknown type name ‘uint32_t’ uint32_t source_id; ^~~~~~~~ ./usr/include/asm/zcrypt.h:169:2: error: unknown type name ‘uint32_t’ uint32_t target_id; ^~~~~~~~ ./usr/include/asm/zcrypt.h:170:2: error: unknown type name ‘uint32_t’ uint32_t ret_code; ^~~~~~~~ ./usr/include/asm/zcrypt.h:171:2: error: unknown type name ‘uint32_t’ uint32_t reserved1; ^~~~~~~~ ./usr/include/asm/zcrypt.h:172:2: error: unknown type name ‘uint32_t’ uint32_t reserved2; ^~~~~~~~ ./usr/include/asm/zcrypt.h:173:2: error: unknown type name ‘uint32_t’ uint32_t payload_len; ^~~~~~~~ ./usr/include/asm/zcrypt.h:182:2: error: unknown type name ‘uint16_t’ uint16_t ap_id; ^~~~~~~~ ./usr/include/asm/zcrypt.h:183:2: error: unknown type name ‘uint16_t’ uint16_t dom_id; ^~~~~~~~ ./usr/include/asm/zcrypt.h:198:2: error: unknown type name ‘uint16_t’ uint16_t targets_num; ^~~~~~~~ ./usr/include/asm/zcrypt.h:199:2: error: unknown type name ‘uint64_t’ uint64_t targets; ^~~~~~~~ ./usr/include/asm/zcrypt.h:200:2: error: unknown type name ‘uint64_t’ uint64_t weight; ^~~~~~~~ ./usr/include/asm/zcrypt.h:201:2: error: unknown type name ‘uint64_t’ uint64_t req_no; ^~~~~~~~ ./usr/include/asm/zcrypt.h:202:2: error: unknown type name ‘uint64_t’ uint64_t req_len; ^~~~~~~~ ./usr/include/asm/zcrypt.h:203:2: error: unknown type name ‘uint64_t’ uint64_t req; ^~~~~~~~ ./usr/include/asm/zcrypt.h:204:2: error: unknown type name ‘uint64_t’ uint64_t resp_len; ^~~~~~~~ ./usr/include/asm/zcrypt.h:205:2: error: unknown type name ‘uint64_t’ uint64_t resp; ^~~~~~~~ Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
1 parent 3f4b04e commit 061c996

1 file changed

Lines changed: 18 additions & 17 deletions

File tree

‎arch/s390/include/uapi/asm/zcrypt.h‎

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include <linux/ioctl.h>
2222
#include <linux/compiler.h>
23+
#include <linux/types.h>
2324

2425
/* Name of the zcrypt device driver. */
2526
#define ZCRYPT_NAME "zcrypt"
@@ -160,17 +161,17 @@ struct ica_xcRB {
160161
* @payload_len: Payload length
161162
*/
162163
struct ep11_cprb {
163-
uint16_t cprb_len;
164+
__u16 cprb_len;
164165
unsigned char cprb_ver_id;
165166
unsigned char pad_000[2];
166167
unsigned char flags;
167168
unsigned char func_id[2];
168-
uint32_t source_id;
169-
uint32_t target_id;
170-
uint32_t ret_code;
171-
uint32_t reserved1;
172-
uint32_t reserved2;
173-
uint32_t payload_len;
169+
__u32 source_id;
170+
__u32 target_id;
171+
__u32 ret_code;
172+
__u32 reserved1;
173+
__u32 reserved2;
174+
__u32 payload_len;
174175
} __attribute__((packed));
175176

176177
/**
@@ -179,8 +180,8 @@ struct ep11_cprb {
179180
* @dom_id: Usage domain id
180181
*/
181182
struct ep11_target_dev {
182-
uint16_t ap_id;
183-
uint16_t dom_id;
183+
__u16 ap_id;
184+
__u16 dom_id;
184185
};
185186

186187
/**
@@ -195,14 +196,14 @@ struct ep11_target_dev {
195196
* @resp: Addr to response block
196197
*/
197198
struct ep11_urb {
198-
uint16_t targets_num;
199-
uint64_t targets;
200-
uint64_t weight;
201-
uint64_t req_no;
202-
uint64_t req_len;
203-
uint64_t req;
204-
uint64_t resp_len;
205-
uint64_t resp;
199+
__u16 targets_num;
200+
__u64 targets;
201+
__u64 weight;
202+
__u64 req_no;
203+
__u64 req_len;
204+
__u64 req;
205+
__u64 resp_len;
206+
__u64 resp;
206207
} __attribute__((packed));
207208

208209
/**

0 commit comments

Comments
 (0)