From patchwork Fri Nov 5 20:48:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12605979 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73751C433EF for ; Fri, 5 Nov 2021 20:48:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2505060174 for ; Fri, 5 Nov 2021 20:48:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2505060174 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id BF32A9400FF; Fri, 5 Nov 2021 16:48:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BA30D9400FA; Fri, 5 Nov 2021 16:48:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A921F9400FF; Fri, 5 Nov 2021 16:48:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0238.hostedemail.com [216.40.44.238]) by kanga.kvack.org (Postfix) with ESMTP id 9BEF29400FA for ; Fri, 5 Nov 2021 16:48:29 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5DBDD180279BC for ; Fri, 5 Nov 2021 20:48:29 +0000 (UTC) X-FDA: 78776064738.12.142C1DD Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf26.hostedemail.com (Postfix) with ESMTP id BE30520019DC for ; Fri, 5 Nov 2021 20:48:29 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 2D47060174; Fri, 5 Nov 2021 20:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1636145308; bh=RAT4aEdVL5c3F3z9sf/D12jBWmrVR201Sw4cXQgfHzY=; h=Date:From:To:Subject:In-Reply-To:From; b=BgRIC4e1uFTx+cf8wdU70Vd6Cz136CJLG22ykCmb8kyT0FI47DD2xOvU9y+V1BD2D WvP3jP326/C1t6rzuyLE+dXn2YYA1Q+WZgtm/B63IAsy0f074Og9Xq7q0NqQnVSYww 33fxFlfFSbX+0Zp/wRQFD0MwF1Tl8uuehtS0WDlw= Date: Fri, 05 Nov 2021 13:48:27 -0700 From: Andrew Morton To: akpm@linux-foundation.org, changbin.du@gmail.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, sj@kernel.org, torvalds@linux-foundation.org Subject: [patch 262/262] mm/damon: remove return value from before_terminate callback Message-ID: <20211105204827.Ep_rdwILj%akpm@linux-foundation.org> In-Reply-To: <20211105133408.cccbb98b71a77d5e8430aba1@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=BgRIC4e1; dmarc=none; spf=pass (imf26.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: BE30520019DC X-Stat-Signature: bjrcn4eieihpn7q4a3ndb4y1f8enbwsx X-HE-Tag: 1636145309-453704 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: From: Changbin Du Subject: mm/damon: remove return value from before_terminate callback Since the return value of 'before_terminate' callback is never used, we make it have no return value. Link: https://lkml.kernel.org/r/20211029005023.8895-1-changbin.du@gmail.com Signed-off-by: Changbin Du Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton --- include/linux/damon.h | 2 +- mm/damon/dbgfs.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) --- a/include/linux/damon.h~mm-damon-remove-return-value-from-before_terminate-callback +++ a/include/linux/damon.h @@ -322,7 +322,7 @@ struct damon_callback { int (*before_start)(struct damon_ctx *context); int (*after_sampling)(struct damon_ctx *context); int (*after_aggregation)(struct damon_ctx *context); - int (*before_terminate)(struct damon_ctx *context); + void (*before_terminate)(struct damon_ctx *context); }; /** --- a/mm/damon/dbgfs.c~mm-damon-remove-return-value-from-before_terminate-callback +++ a/mm/damon/dbgfs.c @@ -645,18 +645,17 @@ static void dbgfs_fill_ctx_dir(struct de debugfs_create_file(file_names[i], 0600, dir, ctx, fops[i]); } -static int dbgfs_before_terminate(struct damon_ctx *ctx) +static void dbgfs_before_terminate(struct damon_ctx *ctx) { struct damon_target *t, *next; if (!targetid_is_pid(ctx)) - return 0; + return; damon_for_each_target_safe(t, next, ctx) { put_pid((struct pid *)t->id); damon_destroy_target(t); } - return 0; } static struct damon_ctx *dbgfs_new_ctx(void)