Loading drivers/soc/qcom/hab/khab_test.c +16 −10 Original line number Diff line number Diff line // 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> Loading Loading @@ -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, Loading @@ -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, Loading @@ -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); Loading @@ -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) 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 pid_stat; /* good result stored */ return count; /* good result stored */ } return -EEXIST; } Loading Loading
drivers/soc/qcom/hab/khab_test.c +16 −10 Original line number Diff line number Diff line // 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> Loading Loading @@ -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, Loading @@ -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, Loading @@ -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); Loading @@ -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) 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 pid_stat; /* good result stored */ return count; /* good result stored */ } return -EEXIST; } Loading