Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp28926lqt; Wed, 5 Jun 2024 16:04:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWdeKVO6TbI2u9ygQ+yTmy2LStDoviXA+6MEAJj3f8zzleMfNEQGQn430Mab70VNLnaHYp9tkJEfj/K19VYn+RzDUwojoqIprzQ6Ld9rA== X-Google-Smtp-Source: AGHT+IFilEaOKjoeJJukS4yMoAhIEda24F00o/E6m8gb1EZCu8ThAByolk2eKRE6ACPpW7+QmhPL X-Received: by 2002:a17:902:e74a:b0:1f6:678c:9e8c with SMTP id d9443c01a7336-1f6a5a8786amr56993195ad.67.1717628696227; Wed, 05 Jun 2024 16:04:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717628696; cv=pass; d=google.com; s=arc-20160816; b=S6mEsBVBJ9C4gM+lruC4ykTgEtSVptDPhxE4E8VEiHz62J+hZ+lpRtMpOkpo5dyhRl Wl8LrbARPbN9zZC0NwJ+RXVLokN2OYCcITJiGRH0NX7nHMI2A6Id1fqViF0D6qX/+VEi ZEQgaqR6jun0vRCutkTU85OXrhoc0p1StyB0nM99A7i5oUaljdIe73p0w7+004n7GA0O FBUvotVN0YsduOQGm9QDHpYsoUUNz8wvFbz0oe63vy0qB9a4XmRB9TTzXjXOuns7h9Kf UBwAikJkgzbIKnmyGmCfrGIPtn4EGfFdJq+RCV4hpJvtxVpCkBzOsUzgOYwXf+BGi9bd cZnA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=DSq+L7iedWXAHd20B5y8TANeudWWFo6WEQwhbuJajRA=; fh=r8cahHtk9ZY6RnB34WVZMxNAFZ6PJVA0hvtHgw/BniI=; b=ou3DOo3sluVe4q7R53EB9XabihzHdcOTHZeZBAS5o6X0sZSR2H3JiDp3FT7eUDes2J xQDzLhQLzbUieP91lyfoitrdezNpBLQuyODUmHp6awL5Aj46I8B/TXg4JLPm9OUKMGK7 ppPf7kQPfG53pca6xNA47HaZBSvEd+zmIgB+7r413aIFy95izcktBm4or42Nj2hRyM6j 3ekjlsGeGujffxn+hSaUqE+oTugXmbPniN3ZMlgu533Ee7shpoQA0Spc5ngt/WweQKcA b79786pHSyNChLwSzDqxdrKLB/xSLkuMQDUsWabiS/u8xlY/47Ce8F1/uiS8Xr+NWLfS r2xg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="W4RsB/q3"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-203382-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203382-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd7f43bcsi62975ad.496.2024.06.05.16.04.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 16:04:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203382-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="W4RsB/q3"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-203382-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203382-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7BCA8B21755 for ; Wed, 5 Jun 2024 23:01:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 620D81607AD; Wed, 5 Jun 2024 23:01:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="W4RsB/q3" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8986ABA38; Wed, 5 Jun 2024 23:01:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717628511; cv=none; b=GIMd7IwcUqY89iTJQVYwue+AGnFZleZCkPcjKS+WS3XSco5LTV8KEEE+RVNA41V991Oc5ZzT1QRr5WwL7+vFY3LlGUrBFOMxPT7ExVJnIcoWtOMqYo6XJIaLHII+83IWzIgfwNLxe4BcvkLcvPkaUIJxBtb32cCnRhtQZRHzfDg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717628511; c=relaxed/simple; bh=Z3h4+PdKb5fP3a2f7pP8Dpq2lfsZWnsIkrMrgnK1Kh0=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=YEV+3yXUoH0UItul4GOhenc/21PtVhOjpInFUiUCrLwhhPx7ggL9Dnk9m+q0ty3GKBsKy1+BP3vmWKyx5kXy2dZovYOLTsCrpktLs5MfOMeBm7h6vrGaThDkFXK5Ew3f5iKhGdH1IwjvtZsR9fbec9sg/t1RZ0RohAPm2jrhAMU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=W4RsB/q3; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62B99C2BD11; Wed, 5 Jun 2024 23:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717628511; bh=Z3h4+PdKb5fP3a2f7pP8Dpq2lfsZWnsIkrMrgnK1Kh0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=W4RsB/q3OYPNHyBjNwIrXJ5dhDMNo6c02n9hk6NVTKxJ0bSLyqmcUwHReqNUoRGfg 2nci0Plb0Fgme8sZon/sMkLNdX4EFxEcR+D7LaINo6uZlVg1J42M2X8N1tBN/pmsRw roBMeBSGyPXybUABfd4eqGbl7u17n09UeMt46qvuM+4LV7BX/4jazpell3cSb2isPZ A2poSOkc7g2OFiN28VbXSuG5DIg2W7D8vThNv2fWI8ED6FXhyt9AGYZyo/F0ZWf7xo pIh6bCqiujZu0u5fgzW8uYJeBD6+HTjc93u6xM1MvZYD7UPvYQx9sn8WSIWcfuK6Ji bycyargZHq88A== Date: Thu, 6 Jun 2024 08:01:47 +0900 From: Masami Hiramatsu (Google) To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: Re: [PATCH v2 1/5] ftrace: Rename dup_hash() and comment it Message-Id: <20240606080147.99c20cd5a638eda8307dc7a7@kernel.org> In-Reply-To: <20240605180408.537723591@goodmis.org> References: <20240605180334.090848865@goodmis.org> <20240605180408.537723591@goodmis.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 05 Jun 2024 14:03:35 -0400 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > The name "dup_hash()" is a misnomer as it does not duplicate the hash that > is passed in, but instead moves its entities from that hash to a newly > allocated one. Rename it to "__move_hash()" (using starting underscores as > it is an internal function), and add some comments about what it does. > Looks good to me. Acked-by: Masami Hiramatsu (Google) > Signed-off-by: Steven Rostedt (Google) > --- > kernel/trace/ftrace.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c > index da7e6abf48b4..9dcdefe9d1aa 100644 > --- a/kernel/trace/ftrace.c > +++ b/kernel/trace/ftrace.c > @@ -1391,7 +1391,11 @@ ftrace_hash_rec_enable_modify(struct ftrace_ops *ops, int filter_hash); > static int ftrace_hash_ipmodify_update(struct ftrace_ops *ops, > struct ftrace_hash *new_hash); > > -static struct ftrace_hash *dup_hash(struct ftrace_hash *src, int size) > +/* > + * Allocate a new hash and remove entries from @src and move them to the new hash. > + * On success, the @src hash will be empty and should be freed. > + */ > +static struct ftrace_hash *__move_hash(struct ftrace_hash *src, int size) > { > struct ftrace_func_entry *entry; > struct ftrace_hash *new_hash; > @@ -1438,7 +1442,7 @@ __ftrace_hash_move(struct ftrace_hash *src) > if (ftrace_hash_empty(src)) > return EMPTY_HASH; > > - return dup_hash(src, size); > + return __move_hash(src, size); > } > > static int > -- > 2.43.0 > > -- Masami Hiramatsu (Google)