diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2019-05-28 11:17:20 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2019-06-03 10:28:57 +1000 |
commit | 66d0ad68687bb12f7fb4301652f434f886998bdf (patch) | |
tree | 8e125fe5325c147469068a2dea0b8cf5e96d1056 /core/opal-msg.c | |
parent | ec9f67bdaedcbfb5836677430da3738c3a3eaa84 (diff) | |
download | skiboot-66d0ad68687bb12f7fb4301652f434f886998bdf.zip skiboot-66d0ad68687bb12f7fb4301652f434f886998bdf.tar.gz skiboot-66d0ad68687bb12f7fb4301652f434f886998bdf.tar.bz2 |
opal-msg: Pass parameter size to _opal_queue_msg()
Currently _opal_queue_msg() takes number of parameters. So far this was
fine as opal_queue_msg() was supporting only fixed number of parameters
(8 * 8 bytes). Soon we are going to introduce variable size parameter.
Hence num_params -> params_size.
Cc: Jeremy Kerr <jk@ozlabs.org>
Cc: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Cc: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Acked-by Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'core/opal-msg.c')
-rw-r--r-- | core/opal-msg.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/opal-msg.c b/core/opal-msg.c index d3dd2ae..907a9e0 100644 --- a/core/opal-msg.c +++ b/core/opal-msg.c @@ -36,7 +36,7 @@ static struct lock opal_msg_lock = LOCK_UNLOCKED; int _opal_queue_msg(enum opal_msg_type msg_type, void *data, void (*consumed)(void *data, int status), - size_t num_params, const u64 *params) + size_t params_size, const void *params) { struct opal_msg_entry *entry; @@ -57,11 +57,11 @@ int _opal_queue_msg(enum opal_msg_type msg_type, void *data, entry->data = data; entry->msg.msg_type = cpu_to_be32(msg_type); - if (num_params > ARRAY_SIZE(entry->msg.params)) { + if (params_size > OPAL_MSG_FIXED_PARAMS_SIZE) { prerror("Discarding extra parameters\n"); - num_params = ARRAY_SIZE(entry->msg.params); + params_size = OPAL_MSG_FIXED_PARAMS_SIZE; } - memcpy(entry->msg.params, params, num_params*sizeof(u64)); + memcpy(entry->msg.params, params, params_size); list_add_tail(&msg_pending_list, &entry->link); opal_update_pending_evt(OPAL_EVENT_MSG_PENDING, |