mirror of https://gitee.com/openkylin/linux.git
powerpc/powernv: Use ssize_t for sysparam return values
The OPAL calls are returning int64_t values, which the sysparam code stores in an int, and the sysfs callback returns ssize_t. Make code a easier to read by consistently using ssize_t. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
parent
ba9a32b176
commit
b8569d2304
|
@ -39,10 +39,11 @@ struct param_attr {
|
|||
struct kobj_attribute kobj_attr;
|
||||
};
|
||||
|
||||
static int opal_get_sys_param(u32 param_id, u32 length, void *buffer)
|
||||
static ssize_t opal_get_sys_param(u32 param_id, u32 length, void *buffer)
|
||||
{
|
||||
struct opal_msg msg;
|
||||
int ret, token;
|
||||
ssize_t ret;
|
||||
int token;
|
||||
|
||||
token = opal_async_get_token_interruptible();
|
||||
if (token < 0) {
|
||||
|
@ -59,7 +60,7 @@ static int opal_get_sys_param(u32 param_id, u32 length, void *buffer)
|
|||
|
||||
ret = opal_async_wait_response(token, &msg);
|
||||
if (ret) {
|
||||
pr_err("%s: Failed to wait for the async response, %d\n",
|
||||
pr_err("%s: Failed to wait for the async response, %zd\n",
|
||||
__func__, ret);
|
||||
goto out_token;
|
||||
}
|
||||
|
@ -111,7 +112,7 @@ static ssize_t sys_param_show(struct kobject *kobj,
|
|||
{
|
||||
struct param_attr *attr = container_of(kobj_attr, struct param_attr,
|
||||
kobj_attr);
|
||||
int ret;
|
||||
ssize_t ret;
|
||||
|
||||
mutex_lock(&opal_sysparam_mutex);
|
||||
ret = opal_get_sys_param(attr->param_id, attr->param_size,
|
||||
|
@ -132,7 +133,7 @@ static ssize_t sys_param_store(struct kobject *kobj,
|
|||
{
|
||||
struct param_attr *attr = container_of(kobj_attr, struct param_attr,
|
||||
kobj_attr);
|
||||
int ret;
|
||||
ssize_t ret;
|
||||
|
||||
mutex_lock(&opal_sysparam_mutex);
|
||||
memcpy(param_data_buf, buf, count);
|
||||
|
|
Loading…
Reference in New Issue