From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751947AbbBEVo1 (ORCPT ); Thu, 5 Feb 2015 16:44:27 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:50231 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750818AbbBEVo0 (ORCPT ); Thu, 5 Feb 2015 16:44:26 -0500 Date: Thu, 5 Feb 2015 21:44:24 +0000 From: Al Viro To: Steven Rostedt Cc: linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH 5/7] trace: make filter_parse_regex() provide the length of substring to compare with Message-ID: <20150205214424.GS29656@ZenIV.linux.org.uk> References: <20150205194914.GR29656@ZenIV.linux.org.uk> <1423166200-1800-5-git-send-email-viro@ZenIV.linux.org.uk> <20150205162933.4fad48f6@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150205162933.4fad48f6@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 05, 2015 at 04:29:33PM -0500, Steven Rostedt wrote: > On Thu, 5 Feb 2015 19:56:38 +0000 > Al Viro wrote: > > > From: Al Viro > > > > ... by passing len by address and using it to report the length of > > substring in question. > > You certainly are very verbose in your change logs. > > What exactly is the purpose of this patch? Clean up? Optimization? > > I can't really tell. Seems like you are just moving the strlen() from > outside the function into it. The point is that by now this strlen() is the only thing for which we NUL-termination of the substring; moving it inside the filter_parse_regex() is an obviously equivalent transformation and it leaves that one strlen() call inside filter_parse_regex() the only place where we still care about NUL. The next commit kills it off completely, at which point we are done with modifying the string at all.