Skip to content

Commit

Permalink
s390/iucv: do not use arrays as argument
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ursula Braun authored and David S. Miller committed Sep 21, 2015
1 parent 4d7def2 commit 91e60eb
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 46 deletions.
4 changes: 2 additions & 2 deletions drivers/s390/char/monreader.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,15 @@ static struct mon_msg *mon_next_message(struct mon_private *monpriv)
/******************************************************************************
* IUCV handler *
*****************************************************************************/
static void mon_iucv_path_complete(struct iucv_path *path, u8 ipuser[16])
static void mon_iucv_path_complete(struct iucv_path *path, u8 *ipuser)
{
struct mon_private *monpriv = path->private;

atomic_set(&monpriv->iucv_connected, 1);
wake_up(&mon_conn_wait_queue);
}

static void mon_iucv_path_severed(struct iucv_path *path, u8 ipuser[16])
static void mon_iucv_path_severed(struct iucv_path *path, u8 *ipuser)
{
struct mon_private *monpriv = path->private;

Expand Down
8 changes: 4 additions & 4 deletions drivers/s390/char/vmlogrdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ static const struct file_operations vmlogrdr_fops = {
};


static void vmlogrdr_iucv_path_complete(struct iucv_path *, u8 ipuser[16]);
static void vmlogrdr_iucv_path_severed(struct iucv_path *, u8 ipuser[16]);
static void vmlogrdr_iucv_path_complete(struct iucv_path *, u8 *ipuser);
static void vmlogrdr_iucv_path_severed(struct iucv_path *, u8 *ipuser);
static void vmlogrdr_iucv_message_pending(struct iucv_path *,
struct iucv_message *);

Expand Down Expand Up @@ -160,7 +160,7 @@ static struct cdev *vmlogrdr_cdev = NULL;
static int recording_class_AB;


static void vmlogrdr_iucv_path_complete(struct iucv_path *path, u8 ipuser[16])
static void vmlogrdr_iucv_path_complete(struct iucv_path *path, u8 *ipuser)
{
struct vmlogrdr_priv_t * logptr = path->private;

Expand All @@ -171,7 +171,7 @@ static void vmlogrdr_iucv_path_complete(struct iucv_path *path, u8 ipuser[16])
}


static void vmlogrdr_iucv_path_severed(struct iucv_path *path, u8 ipuser[16])
static void vmlogrdr_iucv_path_severed(struct iucv_path *path, u8 *ipuser)
{
struct vmlogrdr_priv_t * logptr = path->private;
u8 reason = (u8) ipuser[8];
Expand Down
21 changes: 10 additions & 11 deletions drivers/s390/net/netiucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,11 @@ static struct device_driver netiucv_driver = {
.pm = &netiucv_pm_ops,
};

static int netiucv_callback_connreq(struct iucv_path *,
u8 ipvmid[8], u8 ipuser[16]);
static void netiucv_callback_connack(struct iucv_path *, u8 ipuser[16]);
static void netiucv_callback_connrej(struct iucv_path *, u8 ipuser[16]);
static void netiucv_callback_connsusp(struct iucv_path *, u8 ipuser[16]);
static void netiucv_callback_connres(struct iucv_path *, u8 ipuser[16]);
static int netiucv_callback_connreq(struct iucv_path *, u8 *, u8 *);
static void netiucv_callback_connack(struct iucv_path *, u8 *);
static void netiucv_callback_connrej(struct iucv_path *, u8 *);
static void netiucv_callback_connsusp(struct iucv_path *, u8 *);
static void netiucv_callback_connres(struct iucv_path *, u8 *);
static void netiucv_callback_rx(struct iucv_path *, struct iucv_message *);
static void netiucv_callback_txdone(struct iucv_path *, struct iucv_message *);

Expand Down Expand Up @@ -556,8 +555,8 @@ static void netiucv_callback_connack(struct iucv_path *path, u8 ipuser[16])
fsm_event(conn->fsm, CONN_EVENT_CONN_ACK, conn);
}

static int netiucv_callback_connreq(struct iucv_path *path,
u8 ipvmid[8], u8 ipuser[16])
static int netiucv_callback_connreq(struct iucv_path *path, u8 *ipvmid,
u8 *ipuser)
{
struct iucv_connection *conn = path->private;
struct iucv_event ev;
Expand Down Expand Up @@ -587,21 +586,21 @@ static int netiucv_callback_connreq(struct iucv_path *path,
return rc;
}

static void netiucv_callback_connrej(struct iucv_path *path, u8 ipuser[16])
static void netiucv_callback_connrej(struct iucv_path *path, u8 *ipuser)
{
struct iucv_connection *conn = path->private;

fsm_event(conn->fsm, CONN_EVENT_CONN_REJ, conn);
}

static void netiucv_callback_connsusp(struct iucv_path *path, u8 ipuser[16])
static void netiucv_callback_connsusp(struct iucv_path *path, u8 *ipuser)
{
struct iucv_connection *conn = path->private;

fsm_event(conn->fsm, CONN_EVENT_CONN_SUS, conn);
}

static void netiucv_callback_connres(struct iucv_path *path, u8 ipuser[16])
static void netiucv_callback_connres(struct iucv_path *path, u8 *ipuser)
{
struct iucv_connection *conn = path->private;

Expand Down
5 changes: 2 additions & 3 deletions drivers/s390/net/smsgiucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,15 @@ static DEFINE_SPINLOCK(smsg_list_lock);
static LIST_HEAD(smsg_list);
static int iucv_path_connected;

static int smsg_path_pending(struct iucv_path *, u8 ipvmid[8], u8 ipuser[16]);
static int smsg_path_pending(struct iucv_path *, u8 *, u8 *);
static void smsg_message_pending(struct iucv_path *, struct iucv_message *);

static struct iucv_handler smsg_handler = {
.path_pending = smsg_path_pending,
.message_pending = smsg_message_pending,
};

static int smsg_path_pending(struct iucv_path *path, u8 ipvmid[8],
u8 ipuser[16])
static int smsg_path_pending(struct iucv_path *path, u8 *ipvmid, u8 *ipuser)
{
if (strncmp(ipvmid, "*MSG ", 8) != 0)
return -EINVAL;
Expand Down
10 changes: 5 additions & 5 deletions drivers/tty/hvc/hvc_iucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ struct iucv_tty_buffer {
};

/* IUCV callback handler */
static int hvc_iucv_path_pending(struct iucv_path *, u8[8], u8[16]);
static void hvc_iucv_path_severed(struct iucv_path *, u8[16]);
static int hvc_iucv_path_pending(struct iucv_path *, u8 *, u8 *);
static void hvc_iucv_path_severed(struct iucv_path *, u8 *);
static void hvc_iucv_msg_pending(struct iucv_path *, struct iucv_message *);
static void hvc_iucv_msg_complete(struct iucv_path *, struct iucv_message *);

Expand Down Expand Up @@ -782,8 +782,8 @@ static int hvc_iucv_filter_connreq(u8 ipvmid[8])
*
* Locking: struct hvc_iucv_private->lock
*/
static int hvc_iucv_path_pending(struct iucv_path *path,
u8 ipvmid[8], u8 ipuser[16])
static int hvc_iucv_path_pending(struct iucv_path *path, u8 *ipvmid,
u8 *ipuser)
{
struct hvc_iucv_private *priv, *tmp;
u8 wildcard[9] = "lnxhvc ";
Expand Down Expand Up @@ -881,7 +881,7 @@ static int hvc_iucv_path_pending(struct iucv_path *path,
*
* Locking: struct hvc_iucv_private->lock
*/
static void hvc_iucv_path_severed(struct iucv_path *path, u8 ipuser[16])
static void hvc_iucv_path_severed(struct iucv_path *path, u8 *ipuser)
{
struct hvc_iucv_private *priv = path->private;

Expand Down
20 changes: 10 additions & 10 deletions include/net/iucv/iucv.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,35 +141,35 @@ struct iucv_handler {
* called is the order of the registration of the iucv handlers
* to the base code.
*/
int (*path_pending)(struct iucv_path *, u8 ipvmid[8], u8 ipuser[16]);
int (*path_pending)(struct iucv_path *, u8 *ipvmid, u8 *ipuser);
/*
* The path_complete function is called after an iucv interrupt
* type 0x02 has been received for a path that has been established
* for this handler with iucv_path_connect and got accepted by the
* peer with iucv_path_accept.
*/
void (*path_complete)(struct iucv_path *, u8 ipuser[16]);
void (*path_complete)(struct iucv_path *, u8 *ipuser);
/*
* The path_severed function is called after an iucv interrupt
* type 0x03 has been received. The communication peer shutdown
* his end of the communication path. The path still exists and
* remaining messages can be received until a iucv_path_sever
* shuts down the other end of the path as well.
*/
void (*path_severed)(struct iucv_path *, u8 ipuser[16]);
void (*path_severed)(struct iucv_path *, u8 *ipuser);
/*
* The path_quiesced function is called after an icuv interrupt
* type 0x04 has been received. The communication peer has quiesced
* the path. Delivery of messages is stopped until iucv_path_resume
* has been called.
*/
void (*path_quiesced)(struct iucv_path *, u8 ipuser[16]);
void (*path_quiesced)(struct iucv_path *, u8 *ipuser);
/*
* The path_resumed function is called after an icuv interrupt
* type 0x05 has been received. The communication peer has resumed
* the path.
*/
void (*path_resumed)(struct iucv_path *, u8 ipuser[16]);
void (*path_resumed)(struct iucv_path *, u8 *ipuser);
/*
* The message_pending function is called after an icuv interrupt
* type 0x06 or type 0x07 has been received. A new message is
Expand Down Expand Up @@ -256,7 +256,7 @@ static inline void iucv_path_free(struct iucv_path *path)
* Returns the result of the CP IUCV call.
*/
int iucv_path_accept(struct iucv_path *path, struct iucv_handler *handler,
u8 userdata[16], void *private);
u8 *userdata, void *private);

/**
* iucv_path_connect
Expand All @@ -274,7 +274,7 @@ int iucv_path_accept(struct iucv_path *path, struct iucv_handler *handler,
* Returns the result of the CP IUCV call.
*/
int iucv_path_connect(struct iucv_path *path, struct iucv_handler *handler,
u8 userid[8], u8 system[8], u8 userdata[16],
u8 *userid, u8 *system, u8 *userdata,
void *private);

/**
Expand All @@ -287,7 +287,7 @@ int iucv_path_connect(struct iucv_path *path, struct iucv_handler *handler,
*
* Returns the result from the CP IUCV call.
*/
int iucv_path_quiesce(struct iucv_path *path, u8 userdata[16]);
int iucv_path_quiesce(struct iucv_path *path, u8 *userdata);

/**
* iucv_path_resume:
Expand All @@ -299,7 +299,7 @@ int iucv_path_quiesce(struct iucv_path *path, u8 userdata[16]);
*
* Returns the result from the CP IUCV call.
*/
int iucv_path_resume(struct iucv_path *path, u8 userdata[16]);
int iucv_path_resume(struct iucv_path *path, u8 *userdata);

/**
* iucv_path_sever
Expand All @@ -310,7 +310,7 @@ int iucv_path_resume(struct iucv_path *path, u8 userdata[16]);
*
* Returns the result from the CP IUCV call.
*/
int iucv_path_sever(struct iucv_path *path, u8 userdata[16]);
int iucv_path_sever(struct iucv_path *path, u8 *userdata);

/**
* iucv_message_purge
Expand Down
9 changes: 4 additions & 5 deletions net/iucv/af_iucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,10 @@ static void afiucv_hs_callback_txnotify(struct sk_buff *, enum iucv_tx_notify);
/* Call Back functions */
static void iucv_callback_rx(struct iucv_path *, struct iucv_message *);
static void iucv_callback_txdone(struct iucv_path *, struct iucv_message *);
static void iucv_callback_connack(struct iucv_path *, u8 ipuser[16]);
static int iucv_callback_connreq(struct iucv_path *, u8 ipvmid[8],
u8 ipuser[16]);
static void iucv_callback_connrej(struct iucv_path *, u8 ipuser[16]);
static void iucv_callback_shutdown(struct iucv_path *, u8 ipuser[16]);
static void iucv_callback_connack(struct iucv_path *, u8 *);
static int iucv_callback_connreq(struct iucv_path *, u8 *, u8 *);
static void iucv_callback_connrej(struct iucv_path *, u8 *);
static void iucv_callback_shutdown(struct iucv_path *, u8 *);

static struct iucv_sock_list iucv_sk_list = {
.lock = __RW_LOCK_UNLOCKED(iucv_sk_list.lock),
Expand Down
12 changes: 6 additions & 6 deletions net/iucv/iucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ static struct notifier_block __refdata iucv_cpu_notifier = {
*
* Sever an iucv path to free up the pathid. Used internally.
*/
static int iucv_sever_pathid(u16 pathid, u8 userdata[16])
static int iucv_sever_pathid(u16 pathid, u8 *userdata)
{
union iucv_param *parm;

Expand Down Expand Up @@ -876,7 +876,7 @@ static struct notifier_block iucv_reboot_notifier = {
* Returns the result of the CP IUCV call.
*/
int iucv_path_accept(struct iucv_path *path, struct iucv_handler *handler,
u8 userdata[16], void *private)
u8 *userdata, void *private)
{
union iucv_param *parm;
int rc;
Expand Down Expand Up @@ -923,7 +923,7 @@ EXPORT_SYMBOL(iucv_path_accept);
* Returns the result of the CP IUCV call.
*/
int iucv_path_connect(struct iucv_path *path, struct iucv_handler *handler,
u8 userid[8], u8 system[8], u8 userdata[16],
u8 *userid, u8 *system, u8 *userdata,
void *private)
{
union iucv_param *parm;
Expand Down Expand Up @@ -985,7 +985,7 @@ EXPORT_SYMBOL(iucv_path_connect);
*
* Returns the result from the CP IUCV call.
*/
int iucv_path_quiesce(struct iucv_path *path, u8 userdata[16])
int iucv_path_quiesce(struct iucv_path *path, u8 *userdata)
{
union iucv_param *parm;
int rc;
Expand Down Expand Up @@ -1017,7 +1017,7 @@ EXPORT_SYMBOL(iucv_path_quiesce);
*
* Returns the result from the CP IUCV call.
*/
int iucv_path_resume(struct iucv_path *path, u8 userdata[16])
int iucv_path_resume(struct iucv_path *path, u8 *userdata)
{
union iucv_param *parm;
int rc;
Expand Down Expand Up @@ -1047,7 +1047,7 @@ int iucv_path_resume(struct iucv_path *path, u8 userdata[16])
*
* Returns the result from the CP IUCV call.
*/
int iucv_path_sever(struct iucv_path *path, u8 userdata[16])
int iucv_path_sever(struct iucv_path *path, u8 *userdata)
{
int rc;

Expand Down

0 comments on commit 91e60eb

Please sign in to comment.