From patchwork Wed Dec 1 15:04:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12650155 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 57DA0C433FE for ; Wed, 1 Dec 2021 15:10:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ECC026B0083; Wed, 1 Dec 2021 10:07:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E53E46B0085; Wed, 1 Dec 2021 10:07:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD08D6B0087; Wed, 1 Dec 2021 10:07:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0158.hostedemail.com [216.40.44.158]) by kanga.kvack.org (Postfix) with ESMTP id B20CD6B0083 for ; Wed, 1 Dec 2021 10:07:38 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7786A180B3060 for ; Wed, 1 Dec 2021 15:07:28 +0000 (UTC) X-FDA: 78869554176.13.C929CB8 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf22.hostedemail.com (Postfix) with ESMTP id BC382C9F6 for ; Wed, 1 Dec 2021 15:05:05 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id D7906CE1F97; Wed, 1 Dec 2021 15:05:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0692FC53FD4; Wed, 1 Dec 2021 15:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638371100; bh=QvKLyeU28c3oSLP1SZ6xf8Zv4RAz+uvm7dyfC1S1NOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S6ZOyrMtRVXJ0gxKymQSSiPsPFARFklHLvVFd25Rqhxlm6z2yj2yoHMMMDdW+NsIt /Yn5z3lzZ9gQ0rGZPrGNh1G8a0qmIN6BP4lbOfcYFgzr1boPuQJBakCtGTtef9iJrw gsZDWFNNxzbDfYQeV7edP04a2bchhDxfIBlOMqmYgKsqT1bE5GN7ciRTVJeVj8cocN XqqGW28xR+JnvwZSW7AULLw9Cdq76p7Ka/MfrxLweY5O49ubJGKxCPh6ll0V3droj7 l40DkKMCXSbmUysDNRgVDYWUhoWnp8pgPFT9RR8pK0HmPHgMds2vHmHoyfaIY3U/hD IEs6giIGZpB2g== From: SeongJae Park To: akpm@linux-foundation.org Cc: shuah@kernel.org, brendanhiggins@google.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH 02/11] mm/damon/dbgfs: Remove an unnecessary error message Date: Wed, 1 Dec 2021 15:04:31 +0000 Message-Id: <20211201150440.1088-3-sj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211201150440.1088-1-sj@kernel.org> References: <20211201150440.1088-1-sj@kernel.org> X-Stat-Signature: u45pa7zwus411u4o7g6phq8q4pzxfnux Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=S6ZOyrMt; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: BC382C9F6 X-HE-Tag: 1638371105-444721 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: When wrong scheme action is requested via the debugfs interface, DAMON prints an error message. Because the function returns error code, this is not really needed. Because the code path is triggered by the user specified input, this can result in kernel log mistakenly being messy. To avoid the case, this commit removes the message. Fixes: af122dd8f3c0 ("mm/damon/dbgfs: support DAMON-based Operation Schemes") Signed-off-by: SeongJae Park --- mm/damon/dbgfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c index 4bf4204444ab..5b628990ae6e 100644 --- a/mm/damon/dbgfs.c +++ b/mm/damon/dbgfs.c @@ -210,10 +210,8 @@ static struct damos **str_to_schemes(const char *str, ssize_t len, &wmarks.low, &parsed); if (ret != 18) break; - if (!damos_action_valid(action)) { - pr_err("wrong action %d\n", action); + if (!damos_action_valid(action)) goto fail; - } if (min_sz > max_sz || min_nr_a > max_nr_a || min_age > max_age) goto fail;