Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp353298lqt; Thu, 6 Jun 2024 05:53:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU9nWZZgcgZoKJJVVL4ve6jEH7SqnFxxMFC5oOR81b2VqGXqgYk2oORJwoc84dnqAOZhT1EkOOEYn08MbkGPw6ekm/sjN7Y/Jwfgx2Y2A== X-Google-Smtp-Source: AGHT+IEXAabDHkuG4xp+17SGq5+gVHyAX318Uv51c74p138uxwUh22/cWY2IDpe87rt0fZZYKbdU X-Received: by 2002:a05:622a:94:b0:43f:ed42:6bf0 with SMTP id d75a77b69052e-4402b6dc2b9mr64076051cf.57.1717678394894; Thu, 06 Jun 2024 05:53:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717678394; cv=pass; d=google.com; s=arc-20160816; b=xWkS+JVZouaX0A2Re79VFOIyqQ4NSpzTt6Tx9eIQUET2p0Hldt/p6EIy4T5yNzyOQu 7KD0LoFENt8xywBVX1tFn0rw/OrMjVM3Hm+Kf28GfDCgkxxw9zuANjOoB1CqJVytsT3P r5tqRRdnDmzZv8/A5aw6w97ZsRnvTgkxfdmG+wrwCvgQntspq3BOtlDn/KL+PsP7RSX9 YrkIgvnPzclVtcKeWQfFbCgB76crJuLmS2xO4WiGBKVvpgP2cqvJA53mzbLAuDTbZqoc WwcUTj2OpmZaVcxxKHQqS86nzYgYXbNRyRjQtiz++kwhN/uvYhPXimQ2nqWXBm56jZPa bX4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=ycRpxXHJYSA24AxLLdT6OMy3KD/8p/yJwLx1F8umTCE=; fh=D7vGFCemkZDU34ZWTdMMgxTv/fBH8o6Jqms0Kr1Z2d4=; b=ppdTszIqmE9cXhxvZYnAV9noeHPhMkxPpf/7IRVjzhwnKGImVjMoDcaFEQDcfvzfdM p9nVUa7Udf4/RI0Oq0+ZiT1Yv5As9iHyGsAZKlTvpAZoMMLZVquMrj3GoBl204Gxw092 +t/HGvpssZ21nMuOm2xVRwhnWQb4LESTo2OXCVH63IfRRHVr2FTuSubxCvqcocbBsw0J xUnQCjJq/+/EBP2VD04EMDG6lGD0uMiQLRH48e1/OesNyMcAZ89qwGel/4icpPYEYSi0 rxdz3N911Q1pBNxggstZCkKRrm5TZ6t0ryWFz0Xfa26yfoDObz+Tik7Xk9cXDEQ9pn4W vaRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-204294-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204294-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-44038b16ce3si15218951cf.309.2024.06.06.05.53.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 05:53:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204294-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-204294-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204294-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 93FF31C221AB for ; Thu, 6 Jun 2024 12:53:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8261C195B2D; Thu, 6 Jun 2024 12:53:08 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97B1A195993; Thu, 6 Jun 2024 12:53:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717678388; cv=none; b=ff18qvkW4qLwQL4gepqvkNO1xNeOv97FHyVDf1I2K2UW88g+P+ft+T40RaQff2HnnWOZ2kmtJhx5Tqw7tc2aNfFUCVHNS4q/je5REo9L39oLDF/2QqfcOMRTMBcMk0+6nxLrQG52O4iPeSZqBMNLDw9+I7auHoylfY8WUhuUFNU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717678388; c=relaxed/simple; bh=fRpk2JACrLGpV1chwSwx047Nj1SvEiyU9gcoq9W3hSA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ahmy8niRWojrLFPlPO7ZlPtU8/1fkH+1IoeULec579HavQxJr7RWEeg7YMw4WTjwb/J60hVAnd2iFRpERJqiGbCSNgvlVWJ7mmllD5idSIBGK1QOqXM6q6a8MPi31yXb7fNHOO8Mqqwlz+iRTgBWjrmVOukvO+gvlXm9YKTo1ns= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6E2222F4; Thu, 6 Jun 2024 05:53:30 -0700 (PDT) Received: from J2N7QTR9R3.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1E5983F762; Thu, 6 Jun 2024 05:53:05 -0700 (PDT) Date: Thu, 6 Jun 2024 13:53:02 +0100 From: Mark Rutland To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Masami Hiramatsu , Mathieu Desnoyers , Andrew Morton Subject: Re: [PATCH v2 1/5] ftrace: Rename dup_hash() and comment it Message-ID: References: <20240605180334.090848865@goodmis.org> <20240605180408.537723591@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=us-ascii Content-Disposition: inline In-Reply-To: <20240605180408.537723591@goodmis.org> On Wed, Jun 05, 2024 at 02:03:35PM -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. > > Signed-off-by: Steven Rostedt (Google) Acked-by: Mark Rutland Mark. > --- > 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 > >