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

s390/iucv: do not use arrays as argument

The iucv code uses arrays as arguments. Even though this does not
really cause a problem, it could be misleading, since the compiler
turns array arguments into just a pointer argument. To be more
precise this patch changes the array arguments into pointers.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Ursula Braun and committed by
David S. Miller
91e60eb6 4d7def2a

+43 -46
+2 -2
drivers/s390/char/monreader.c
··· 229 229 /****************************************************************************** 230 230 * IUCV handler * 231 231 *****************************************************************************/ 232 - static void mon_iucv_path_complete(struct iucv_path *path, u8 ipuser[16]) 232 + static void mon_iucv_path_complete(struct iucv_path *path, u8 *ipuser) 233 233 { 234 234 struct mon_private *monpriv = path->private; 235 235 ··· 237 237 wake_up(&mon_conn_wait_queue); 238 238 } 239 239 240 - static void mon_iucv_path_severed(struct iucv_path *path, u8 ipuser[16]) 240 + static void mon_iucv_path_severed(struct iucv_path *path, u8 *ipuser) 241 241 { 242 242 struct mon_private *monpriv = path->private; 243 243
+4 -4
drivers/s390/char/vmlogrdr.c
··· 99 99 }; 100 100 101 101 102 - static void vmlogrdr_iucv_path_complete(struct iucv_path *, u8 ipuser[16]); 103 - static void vmlogrdr_iucv_path_severed(struct iucv_path *, u8 ipuser[16]); 102 + static void vmlogrdr_iucv_path_complete(struct iucv_path *, u8 *ipuser); 103 + static void vmlogrdr_iucv_path_severed(struct iucv_path *, u8 *ipuser); 104 104 static void vmlogrdr_iucv_message_pending(struct iucv_path *, 105 105 struct iucv_message *); 106 106 ··· 160 160 static int recording_class_AB; 161 161 162 162 163 - static void vmlogrdr_iucv_path_complete(struct iucv_path *path, u8 ipuser[16]) 163 + static void vmlogrdr_iucv_path_complete(struct iucv_path *path, u8 *ipuser) 164 164 { 165 165 struct vmlogrdr_priv_t * logptr = path->private; 166 166 ··· 171 171 } 172 172 173 173 174 - static void vmlogrdr_iucv_path_severed(struct iucv_path *path, u8 ipuser[16]) 174 + static void vmlogrdr_iucv_path_severed(struct iucv_path *path, u8 *ipuser) 175 175 { 176 176 struct vmlogrdr_priv_t * logptr = path->private; 177 177 u8 reason = (u8) ipuser[8];
+10 -11
drivers/s390/net/netiucv.c
··· 149 149 .pm = &netiucv_pm_ops, 150 150 }; 151 151 152 - static int netiucv_callback_connreq(struct iucv_path *, 153 - u8 ipvmid[8], u8 ipuser[16]); 154 - static void netiucv_callback_connack(struct iucv_path *, u8 ipuser[16]); 155 - static void netiucv_callback_connrej(struct iucv_path *, u8 ipuser[16]); 156 - static void netiucv_callback_connsusp(struct iucv_path *, u8 ipuser[16]); 157 - static void netiucv_callback_connres(struct iucv_path *, u8 ipuser[16]); 152 + static int netiucv_callback_connreq(struct iucv_path *, u8 *, u8 *); 153 + static void netiucv_callback_connack(struct iucv_path *, u8 *); 154 + static void netiucv_callback_connrej(struct iucv_path *, u8 *); 155 + static void netiucv_callback_connsusp(struct iucv_path *, u8 *); 156 + static void netiucv_callback_connres(struct iucv_path *, u8 *); 158 157 static void netiucv_callback_rx(struct iucv_path *, struct iucv_message *); 159 158 static void netiucv_callback_txdone(struct iucv_path *, struct iucv_message *); 160 159 ··· 555 556 fsm_event(conn->fsm, CONN_EVENT_CONN_ACK, conn); 556 557 } 557 558 558 - static int netiucv_callback_connreq(struct iucv_path *path, 559 - u8 ipvmid[8], u8 ipuser[16]) 559 + static int netiucv_callback_connreq(struct iucv_path *path, u8 *ipvmid, 560 + u8 *ipuser) 560 561 { 561 562 struct iucv_connection *conn = path->private; 562 563 struct iucv_event ev; ··· 586 587 return rc; 587 588 } 588 589 589 - static void netiucv_callback_connrej(struct iucv_path *path, u8 ipuser[16]) 590 + static void netiucv_callback_connrej(struct iucv_path *path, u8 *ipuser) 590 591 { 591 592 struct iucv_connection *conn = path->private; 592 593 593 594 fsm_event(conn->fsm, CONN_EVENT_CONN_REJ, conn); 594 595 } 595 596 596 - static void netiucv_callback_connsusp(struct iucv_path *path, u8 ipuser[16]) 597 + static void netiucv_callback_connsusp(struct iucv_path *path, u8 *ipuser) 597 598 { 598 599 struct iucv_connection *conn = path->private; 599 600 600 601 fsm_event(conn->fsm, CONN_EVENT_CONN_SUS, conn); 601 602 } 602 603 603 - static void netiucv_callback_connres(struct iucv_path *path, u8 ipuser[16]) 604 + static void netiucv_callback_connres(struct iucv_path *path, u8 *ipuser) 604 605 { 605 606 struct iucv_connection *conn = path->private; 606 607
+2 -3
drivers/s390/net/smsgiucv.c
··· 49 49 static LIST_HEAD(smsg_list); 50 50 static int iucv_path_connected; 51 51 52 - static int smsg_path_pending(struct iucv_path *, u8 ipvmid[8], u8 ipuser[16]); 52 + static int smsg_path_pending(struct iucv_path *, u8 *, u8 *); 53 53 static void smsg_message_pending(struct iucv_path *, struct iucv_message *); 54 54 55 55 static struct iucv_handler smsg_handler = { ··· 57 57 .message_pending = smsg_message_pending, 58 58 }; 59 59 60 - static int smsg_path_pending(struct iucv_path *path, u8 ipvmid[8], 61 - u8 ipuser[16]) 60 + static int smsg_path_pending(struct iucv_path *path, u8 *ipvmid, u8 *ipuser) 62 61 { 63 62 if (strncmp(ipvmid, "*MSG ", 8) != 0) 64 63 return -EINVAL;
+5 -5
drivers/tty/hvc/hvc_iucv.c
··· 88 88 }; 89 89 90 90 /* IUCV callback handler */ 91 - static int hvc_iucv_path_pending(struct iucv_path *, u8[8], u8[16]); 92 - static void hvc_iucv_path_severed(struct iucv_path *, u8[16]); 91 + static int hvc_iucv_path_pending(struct iucv_path *, u8 *, u8 *); 92 + static void hvc_iucv_path_severed(struct iucv_path *, u8 *); 93 93 static void hvc_iucv_msg_pending(struct iucv_path *, struct iucv_message *); 94 94 static void hvc_iucv_msg_complete(struct iucv_path *, struct iucv_message *); 95 95 ··· 782 782 * 783 783 * Locking: struct hvc_iucv_private->lock 784 784 */ 785 - static int hvc_iucv_path_pending(struct iucv_path *path, 786 - u8 ipvmid[8], u8 ipuser[16]) 785 + static int hvc_iucv_path_pending(struct iucv_path *path, u8 *ipvmid, 786 + u8 *ipuser) 787 787 { 788 788 struct hvc_iucv_private *priv, *tmp; 789 789 u8 wildcard[9] = "lnxhvc "; ··· 881 881 * 882 882 * Locking: struct hvc_iucv_private->lock 883 883 */ 884 - static void hvc_iucv_path_severed(struct iucv_path *path, u8 ipuser[16]) 884 + static void hvc_iucv_path_severed(struct iucv_path *path, u8 *ipuser) 885 885 { 886 886 struct hvc_iucv_private *priv = path->private; 887 887
+10 -10
include/net/iucv/iucv.h
··· 141 141 * called is the order of the registration of the iucv handlers 142 142 * to the base code. 143 143 */ 144 - int (*path_pending)(struct iucv_path *, u8 ipvmid[8], u8 ipuser[16]); 144 + int (*path_pending)(struct iucv_path *, u8 *ipvmid, u8 *ipuser); 145 145 /* 146 146 * The path_complete function is called after an iucv interrupt 147 147 * type 0x02 has been received for a path that has been established 148 148 * for this handler with iucv_path_connect and got accepted by the 149 149 * peer with iucv_path_accept. 150 150 */ 151 - void (*path_complete)(struct iucv_path *, u8 ipuser[16]); 151 + void (*path_complete)(struct iucv_path *, u8 *ipuser); 152 152 /* 153 153 * The path_severed function is called after an iucv interrupt 154 154 * type 0x03 has been received. The communication peer shutdown ··· 156 156 * remaining messages can be received until a iucv_path_sever 157 157 * shuts down the other end of the path as well. 158 158 */ 159 - void (*path_severed)(struct iucv_path *, u8 ipuser[16]); 159 + void (*path_severed)(struct iucv_path *, u8 *ipuser); 160 160 /* 161 161 * The path_quiesced function is called after an icuv interrupt 162 162 * type 0x04 has been received. The communication peer has quiesced 163 163 * the path. Delivery of messages is stopped until iucv_path_resume 164 164 * has been called. 165 165 */ 166 - void (*path_quiesced)(struct iucv_path *, u8 ipuser[16]); 166 + void (*path_quiesced)(struct iucv_path *, u8 *ipuser); 167 167 /* 168 168 * The path_resumed function is called after an icuv interrupt 169 169 * type 0x05 has been received. The communication peer has resumed 170 170 * the path. 171 171 */ 172 - void (*path_resumed)(struct iucv_path *, u8 ipuser[16]); 172 + void (*path_resumed)(struct iucv_path *, u8 *ipuser); 173 173 /* 174 174 * The message_pending function is called after an icuv interrupt 175 175 * type 0x06 or type 0x07 has been received. A new message is ··· 256 256 * Returns the result of the CP IUCV call. 257 257 */ 258 258 int iucv_path_accept(struct iucv_path *path, struct iucv_handler *handler, 259 - u8 userdata[16], void *private); 259 + u8 *userdata, void *private); 260 260 261 261 /** 262 262 * iucv_path_connect ··· 274 274 * Returns the result of the CP IUCV call. 275 275 */ 276 276 int iucv_path_connect(struct iucv_path *path, struct iucv_handler *handler, 277 - u8 userid[8], u8 system[8], u8 userdata[16], 277 + u8 *userid, u8 *system, u8 *userdata, 278 278 void *private); 279 279 280 280 /** ··· 287 287 * 288 288 * Returns the result from the CP IUCV call. 289 289 */ 290 - int iucv_path_quiesce(struct iucv_path *path, u8 userdata[16]); 290 + int iucv_path_quiesce(struct iucv_path *path, u8 *userdata); 291 291 292 292 /** 293 293 * iucv_path_resume: ··· 299 299 * 300 300 * Returns the result from the CP IUCV call. 301 301 */ 302 - int iucv_path_resume(struct iucv_path *path, u8 userdata[16]); 302 + int iucv_path_resume(struct iucv_path *path, u8 *userdata); 303 303 304 304 /** 305 305 * iucv_path_sever ··· 310 310 * 311 311 * Returns the result from the CP IUCV call. 312 312 */ 313 - int iucv_path_sever(struct iucv_path *path, u8 userdata[16]); 313 + int iucv_path_sever(struct iucv_path *path, u8 *userdata); 314 314 315 315 /** 316 316 * iucv_message_purge
+4 -5
net/iucv/af_iucv.c
··· 95 95 /* Call Back functions */ 96 96 static void iucv_callback_rx(struct iucv_path *, struct iucv_message *); 97 97 static void iucv_callback_txdone(struct iucv_path *, struct iucv_message *); 98 - static void iucv_callback_connack(struct iucv_path *, u8 ipuser[16]); 99 - static int iucv_callback_connreq(struct iucv_path *, u8 ipvmid[8], 100 - u8 ipuser[16]); 101 - static void iucv_callback_connrej(struct iucv_path *, u8 ipuser[16]); 102 - static void iucv_callback_shutdown(struct iucv_path *, u8 ipuser[16]); 98 + static void iucv_callback_connack(struct iucv_path *, u8 *); 99 + static int iucv_callback_connreq(struct iucv_path *, u8 *, u8 *); 100 + static void iucv_callback_connrej(struct iucv_path *, u8 *); 101 + static void iucv_callback_shutdown(struct iucv_path *, u8 *); 103 102 104 103 static struct iucv_sock_list iucv_sk_list = { 105 104 .lock = __RW_LOCK_UNLOCKED(iucv_sk_list.lock),
+6 -6
net/iucv/iucv.c
··· 713 713 * 714 714 * Sever an iucv path to free up the pathid. Used internally. 715 715 */ 716 - static int iucv_sever_pathid(u16 pathid, u8 userdata[16]) 716 + static int iucv_sever_pathid(u16 pathid, u8 *userdata) 717 717 { 718 718 union iucv_param *parm; 719 719 ··· 876 876 * Returns the result of the CP IUCV call. 877 877 */ 878 878 int iucv_path_accept(struct iucv_path *path, struct iucv_handler *handler, 879 - u8 userdata[16], void *private) 879 + u8 *userdata, void *private) 880 880 { 881 881 union iucv_param *parm; 882 882 int rc; ··· 923 923 * Returns the result of the CP IUCV call. 924 924 */ 925 925 int iucv_path_connect(struct iucv_path *path, struct iucv_handler *handler, 926 - u8 userid[8], u8 system[8], u8 userdata[16], 926 + u8 *userid, u8 *system, u8 *userdata, 927 927 void *private) 928 928 { 929 929 union iucv_param *parm; ··· 985 985 * 986 986 * Returns the result from the CP IUCV call. 987 987 */ 988 - int iucv_path_quiesce(struct iucv_path *path, u8 userdata[16]) 988 + int iucv_path_quiesce(struct iucv_path *path, u8 *userdata) 989 989 { 990 990 union iucv_param *parm; 991 991 int rc; ··· 1017 1017 * 1018 1018 * Returns the result from the CP IUCV call. 1019 1019 */ 1020 - int iucv_path_resume(struct iucv_path *path, u8 userdata[16]) 1020 + int iucv_path_resume(struct iucv_path *path, u8 *userdata) 1021 1021 { 1022 1022 union iucv_param *parm; 1023 1023 int rc; ··· 1047 1047 * 1048 1048 * Returns the result from the CP IUCV call. 1049 1049 */ 1050 - int iucv_path_sever(struct iucv_path *path, u8 userdata[16]) 1050 + int iucv_path_sever(struct iucv_path *path, u8 *userdata) 1051 1051 { 1052 1052 int rc; 1053 1053