Merge "soc: qcom: hab: Updating return value for function attributed to kobject"

This commit is contained in:
qctecmdr 2021-08-03 23:48:00 -07:00 • committed by Gerrit - the friendly Code Review server
commit bca4e894c5

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
*/
#include "hab.h"
#include <linux/rtc.h>
@ -274,7 +274,7 @@ static ssize_t vchan_store(struct kobject *kobj, struct kobj_attribute *attr,
pr_err("failed to read anything from input %d\n", ret);
return 0;
} else
return vchan_stat;
return count;
}
static ssize_t ctx_show(struct kobject *kobj, struct kobj_attribute *attr,
@ -293,7 +293,7 @@ static ssize_t ctx_store(struct kobject *kobj, struct kobj_attribute *attr,
pr_err("failed to read anything from input %d\n", ret);
return 0;
} else
return context_stat;
return count;
}
static ssize_t expimp_show(struct kobject *kobj, struct kobj_attribute *attr,
@ -305,10 +305,11 @@ static ssize_t expimp_show(struct kobject *kobj, struct kobj_attribute *attr,
static ssize_t expimp_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count)
{
int ret;
int ret = -1;
char str[36] = {0};
unsigned long temp;
ret = sscanf(buf, "%35s", str);
ret = sscanf(buf, "%s", str);
if (ret < 1)
pr_err("failed to read anything from input %d\n", ret);
@ -319,11 +320,16 @@ static ssize_t expimp_store(struct kobject *kobj, struct kobj_attribute *attr,
return strlen("dump_pipe");
}
ret = sscanf(buf, "%du", &pid_stat);
if (ret < 1)
pr_err("failed to read anything from input %d\n", ret);
else
return pid_stat; /* good result stored */
if (buf) {
ret = kstrtol(buf, 10, &temp);
pid_stat = temp;
if (ret < 0)
pr_err("failed to read anything from input %d\n", ret);
else
return count; /* good result stored */
}
return -EEXIST;
}