Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

s390/zcrypt: Move inline function rng_type6cprb_msgx from header to code

Function rng_type6cprb_msgx() is only used once and thus no need
to provide it in header file any more. Move it at the place within
the code where it is used.

Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Anthony Krowiak <akrowiak@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

authored by

Harald Freudenberger and committed by
Vasily Gorbik
23a4757d fa8be59c

+49 -49
+49
drivers/s390/crypto/zcrypt_msgtype6.c
··· 1250 1250 return rc; 1251 1251 } 1252 1252 1253 + /** 1254 + * Prepare a type6 CPRB message for random number generation 1255 + * 1256 + * @ap_dev: AP device pointer 1257 + * @ap_msg: pointer to AP message 1258 + */ 1259 + static inline void rng_type6cprb_msgx(struct ap_message *ap_msg, 1260 + unsigned int random_number_length, 1261 + unsigned int *domain) 1262 + { 1263 + struct { 1264 + struct type6_hdr hdr; 1265 + struct CPRBX cprbx; 1266 + char function_code[2]; 1267 + short int rule_length; 1268 + char rule[8]; 1269 + short int verb_length; 1270 + short int key_length; 1271 + } __packed * msg = ap_msg->msg; 1272 + static struct type6_hdr static_type6_hdrX = { 1273 + .type = 0x06, 1274 + .offset1 = 0x00000058, 1275 + .agent_id = {'C', 'A'}, 1276 + .function_code = {'R', 'L'}, 1277 + .tocardlen1 = sizeof(*msg) - sizeof(msg->hdr), 1278 + .fromcardlen1 = sizeof(*msg) - sizeof(msg->hdr), 1279 + }; 1280 + static struct CPRBX local_cprbx = { 1281 + .cprb_len = 0x00dc, 1282 + .cprb_ver_id = 0x02, 1283 + .func_id = {0x54, 0x32}, 1284 + .req_parml = sizeof(*msg) - sizeof(msg->hdr) - 1285 + sizeof(msg->cprbx), 1286 + .rpl_msgbl = sizeof(*msg) - sizeof(msg->hdr), 1287 + }; 1288 + 1289 + msg->hdr = static_type6_hdrX; 1290 + msg->hdr.fromcardlen2 = random_number_length; 1291 + msg->cprbx = local_cprbx; 1292 + msg->cprbx.rpl_datal = random_number_length; 1293 + memcpy(msg->function_code, msg->hdr.function_code, 0x02); 1294 + msg->rule_length = 0x0a; 1295 + memcpy(msg->rule, "RANDOM ", 8); 1296 + msg->verb_length = 0x02; 1297 + msg->key_length = 0x02; 1298 + ap_msg->len = sizeof(*msg); 1299 + *domain = (unsigned short)msg->cprbx.domain; 1300 + } 1301 + 1253 1302 /* 1254 1303 * Prepare a CEXXC get random request ap message. 1255 1304 * This function assumes that ap_msg has been initialized with
-49
drivers/s390/crypto/zcrypt_msgtype6.h
··· 110 110 int speed_idx_cca(int); 111 111 int speed_idx_ep11(int); 112 112 113 - /** 114 - * Prepare a type6 CPRB message for random number generation 115 - * 116 - * @ap_dev: AP device pointer 117 - * @ap_msg: pointer to AP message 118 - */ 119 - static inline void rng_type6cprb_msgx(struct ap_message *ap_msg, 120 - unsigned int random_number_length, 121 - unsigned int *domain) 122 - { 123 - struct { 124 - struct type6_hdr hdr; 125 - struct CPRBX cprbx; 126 - char function_code[2]; 127 - short int rule_length; 128 - char rule[8]; 129 - short int verb_length; 130 - short int key_length; 131 - } __packed * msg = ap_msg->msg; 132 - static struct type6_hdr static_type6_hdrX = { 133 - .type = 0x06, 134 - .offset1 = 0x00000058, 135 - .agent_id = {'C', 'A'}, 136 - .function_code = {'R', 'L'}, 137 - .tocardlen1 = sizeof(*msg) - sizeof(msg->hdr), 138 - .fromcardlen1 = sizeof(*msg) - sizeof(msg->hdr), 139 - }; 140 - static struct CPRBX local_cprbx = { 141 - .cprb_len = 0x00dc, 142 - .cprb_ver_id = 0x02, 143 - .func_id = {0x54, 0x32}, 144 - .req_parml = sizeof(*msg) - sizeof(msg->hdr) - 145 - sizeof(msg->cprbx), 146 - .rpl_msgbl = sizeof(*msg) - sizeof(msg->hdr), 147 - }; 148 - 149 - msg->hdr = static_type6_hdrX; 150 - msg->hdr.fromcardlen2 = random_number_length; 151 - msg->cprbx = local_cprbx; 152 - msg->cprbx.rpl_datal = random_number_length; 153 - memcpy(msg->function_code, msg->hdr.function_code, 0x02); 154 - msg->rule_length = 0x0a; 155 - memcpy(msg->rule, "RANDOM ", 8); 156 - msg->verb_length = 0x02; 157 - msg->key_length = 0x02; 158 - ap_msg->len = sizeof(*msg); 159 - *domain = (unsigned short)msg->cprbx.domain; 160 - } 161 - 162 113 void zcrypt_msgtype6_init(void); 163 114 void zcrypt_msgtype6_exit(void); 164 115