Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp331477lqt; Thu, 6 Jun 2024 05:13:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWofrMNo9JXUTIQ8q4DphRWAFTK75SKgRfbRn0SpAvL/ONwZ/oWZXAhgxLajIQRrq/w9WE36rinIATI5VQ8t5IGYa9hEq0/tJ29Hp/wWA== X-Google-Smtp-Source: AGHT+IHqJKDOXhUGxVse5d3tuggaucP7cs4uvj+zDDnlGBbwsoKVDLCo/aqS7BebiPcuVZUcs9Th X-Received: by 2002:a17:906:b1cb:b0:a68:c6e5:3574 with SMTP id a640c23a62f3a-a69a0000bdbmr324602066b.75.1717675994643; Thu, 06 Jun 2024 05:13:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717675994; cv=pass; d=google.com; s=arc-20160816; b=I208qCyLfra56EiNddnXMS2K803w/Zave5/nU1XZeEhvV2FLCMotaoGQ4FzSPHUB5X AAjbkk4kreCZ3/lAKkJyBui+wDHa6wXQQ2Xu3Up72QrIiEvExzzyOWRY1HSFD5rESaQB djUpLJamSgmsMiAq41OEDQAb/5OepfFJydSYiTaFMvtRJ5D7pu1hhyVqPP4Po0JGO+GX ryjOO+M3da9fRh8VMJf8rlaxLS12gS91vttWT0iIc/jVIY9GU51A6faw2uFZ4YKVqWrF LhE87q9wDN5WvRorilvS7x5LN58MFpe0ErONA+Ecv8nR6SGIUCsmPez4vpRwkz4pZwqb 3fzw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:subject:cc:to:from:date:user-agent:message-id; bh=ATh4hkrv79NVUqIOuu7P3QOVxOHX//XQx1kAYTvYmjg=; fh=mTYg3JJ8i2GBNLFt8qb4bgYwOyk0kmrOzICLbi6qJ1c=; b=lDX3UvbYt3PHgP21Vm91Y/UKid9tQsqMUeEfkOlJbDgdqoYi2Bwd4PagkERRsjtDua fp6K3VG7mqcING05Rx98/NYRO7rWBAtKSArUcJPrDl/zzky6RjiGMoQMb3Q0MoF6c3wi T3K4SZfpRG3DHtQoqxMfbVKvqztfmLEfptkryAgNKcE8bSmoh+rszd2Apfb2EQ0ram+U B2FxuaQo79xYND7oUxfhMuPFdo68B4td48MeAcVqE9k8s8EvJ8zStZmCCxhTNQqdfiIk Aeq6CyTXLcio/vq+S3OL9tS8DA6XWFXUFzWMKgllFx/ndrPvBt7iT9KofwUGNrTCc1BJ 5mfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-204243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204243-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c80708fe2si61372366b.634.2024.06.06.05.13.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 05:13:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-204243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204243-linux.lists.archive=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id A8B881F234EF for ; Thu, 6 Jun 2024 12:13:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 98788195FD2; Thu, 6 Jun 2024 12:11:01 +0000 (UTC) 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 171C6195F08 for ; Thu, 6 Jun 2024 12:11:00 +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=1717675861; cv=none; b=eVH+uDKX1tUeixnbgYQFaD8pTxMVSN9eI6teQEewuaaGxAghTZS6nxmeNqxr043EZcGix9Aw34W1KFH6v64aaEobeX4ygtOzib4al9u2O+knG11v40SU8vJYUnT2GGWi/2pqW8NtCv7CfyUiP88L+Tqs3cBK64ag4K80OEyrPDo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717675861; c=relaxed/simple; bh=c9qk2ba39DxvpoLJ7rt1t9FBbO0uYm2kZ33GQZpUTfQ=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=ZD45h7VhZLiPjPppZDCYoNJyuxngA/rYSTkL/Ao0KYfadrKZn/B2tl7j0wIXs4CEr5zU4m7Y0UjKJzr0glYDay95EnI/VxhUdQrY1pcw0WLQZmR9CsY54Wd52JD4sNF7ux77PO63eHjZ4AljOIryN5OWDd/ysIfL75hFRs3Ux0w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8880BC4AF60; Thu, 6 Jun 2024 12:11:00 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sFBxR-00000000nJr-04Tq; Thu, 06 Jun 2024 08:11:05 -0400 Message-ID: <20240606121104.879342374@goodmis.org> User-Agent: quilt/0.68 Date: Thu, 06 Jun 2024 08:10:07 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [for-next][PATCH 03/15] ftrace: Rename dup_hash() and comment it References: <20240606121004.857581251@goodmis.org> 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=UTF-8 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. Link: https://lore.kernel.org/linux-trace-kernel/20240605180408.537723591@goodmis.org Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Andrew Morton 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 897d7541041c..f4b253d20df8 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -1392,7 +1392,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; @@ -1439,7 +1443,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