Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bca4e894 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 0a69438b 91652644
Loading
Loading
Loading
Loading
+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>
@@ -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)
	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;
}