From patchwork Mon Sep 19 15:12:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: haoxin X-Patchwork-Id: 12980588 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9AC0C54EE9 for ; Mon, 19 Sep 2022 15:12:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6365180007; Mon, 19 Sep 2022 11:12:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5BC1D6B0072; Mon, 19 Sep 2022 11:12:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45DED80007; Mon, 19 Sep 2022 11:12:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 31E556B0071 for ; Mon, 19 Sep 2022 11:12:16 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id DA4D2403C2 for ; Mon, 19 Sep 2022 15:12:15 +0000 (UTC) X-FDA: 79929175830.28.758A2A4 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by imf13.hostedemail.com (Postfix) with ESMTP id EB0472002C for ; Mon, 19 Sep 2022 15:12:14 +0000 (UTC) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=xhao@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VQEvWFT_1663600327; Received: from localhost.localdomain(mailfrom:xhao@linux.alibaba.com fp:SMTPD_---0VQEvWFT_1663600327) by smtp.aliyun-inc.com; Mon, 19 Sep 2022 23:12:08 +0800 From: Xin Hao To: sj@kernel.org Cc: akpm@linux-foundation.org, damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, xhao@linux.alibaba.com Subject: [PATCH v1 1/2] mm/damon/sysfs: remove unnecessary variables Date: Mon, 19 Sep 2022 23:12:00 +0800 Message-Id: <20220919151201.66696-1-xhao@linux.alibaba.com> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663600335; a=rsa-sha256; cv=none; b=jFOJkPceBqeYYPgk9p0M3nol+7zYT53GsuFyqD9Kazvf/9d2XoGsDVRoOtBdi2gciOHFBg iKjnXPRvZMJAgQS4DuzCUaZ7MqZ5C5L0tqI5s3Eav1MtEtFD+HWxYRc0PVFIVK5HPz4F9J gc8+w0Gsnj9FSbWHP8ZrbAJWTOQlrKk= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of xhao@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=xhao@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663600335; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=6kXjt9klxOIJxkIvtVJsSintQwVu+1ck8KoWsUDYBGo=; b=JdFiV0O/ok3+xcy7OYJB+IJidta7HIBmcXG1bbKPBEz7o8MeAng+4vnGsvhc/VPSCKadsw /TW9RhRYiovsuh+DuY7NA0YG0w6NAA4ZYzVQAKnaCDZPBjTEDLf/sDZ3uA0KXLpGdUEqLp ECY2QTaVq5Xyr3aDnDYgpsu/8VxYrHo= X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: EB0472002C Authentication-Results: imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of xhao@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=xhao@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com X-Stat-Signature: ym1z7mg5j7b4j6399gdd7jt6s97xp54j X-HE-Tag: 1663600334-953740 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Just do a little change here, the 'err' variable really no need to stay here. Signed-off-by: Xin Hao --- mm/damon/sysfs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.31.0 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, ®ion->start); - if (err) + if (kstrtoul(buf, 0, ®ion->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, ®ion->end); - if (err) + if (kstrtoul(buf, 0, ®ion->end)) return -EINVAL; return count; }