linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] mm/damon/sysfs: remove unnecessary variables
@ 2022-09-19 15:12 Xin Hao
  2022-09-19 15:12 ` [PATCH v1 2/2] mm/damon/sysfs: use kzmalloc instead kmalloc to simplify codes Xin Hao
  2022-09-19 17:03 ` [PATCH v1 1/2] mm/damon/sysfs: remove unnecessary variables SeongJae Park
  0 siblings, 2 replies; 8+ messages in thread
From: Xin Hao @ 2022-09-19 15:12 UTC (permalink / raw)
  To: sj; +Cc: akpm, damon, linux-mm, linux-kernel, xhao

Just do a little change here, the 'err' variable really no need to stay
here.

Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
---
 mm/damon/sysfs.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c
index 0cca1909bf67..b852a75b9f39 100644
--- a/mm/damon/sysfs.c
+++ b/mm/damon/sysfs.c
@@ -1109,9 +1109,8 @@ static ssize_t start_store(struct kobject *kobj, struct kobj_attribute *attr,
 {
 	struct damon_sysfs_region *region = container_of(kobj,
 			struct damon_sysfs_region, kobj);
-	int err = kstrtoul(buf, 0, &region->start);

-	if (err)
+	if (kstrtoul(buf, 0, &region->start))
 		return -EINVAL;
 	return count;
 }
@@ -1130,9 +1129,8 @@ static ssize_t end_store(struct kobject *kobj, struct kobj_attribute *attr,
 {
 	struct damon_sysfs_region *region = container_of(kobj,
 			struct damon_sysfs_region, kobj);
-	int err = kstrtoul(buf, 0, &region->end);

-	if (err)
+	if (kstrtoul(buf, 0, &region->end))
 		return -EINVAL;
 	return count;
 }
--
2.31.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-09-21  5:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-19 15:12 [PATCH v1 1/2] mm/damon/sysfs: remove unnecessary variables Xin Hao
2022-09-19 15:12 ` [PATCH v1 2/2] mm/damon/sysfs: use kzmalloc instead kmalloc to simplify codes Xin Hao
2022-09-19 17:22   ` SeongJae Park
2022-09-20  1:58     ` haoxin
2022-09-20 16:25       ` SeongJae Park
2022-09-21  5:20         ` haoxin
2022-09-19 17:03 ` [PATCH v1 1/2] mm/damon/sysfs: remove unnecessary variables SeongJae Park
2022-09-20  1:54   ` haoxin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).