From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Rostedt Date: Sun, 23 Dec 2018 03:46:31 +0000 Subject: Re: [for-next][PATCH 5/5] tracing: Use the return of str_has_prefix() to remove open coded numbers Message-Id: <20181222224631.02e27c51@vmware.local.home> List-Id: References: <20181222162007.697862256@goodmis.org> <20181222162857.116914355@goodmis.org> <20181223122352.dd3c077443f0b6621a796039@kernel.org> In-Reply-To: <20181223122352.dd3c077443f0b6621a796039@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Masami Hiramatsu Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Joe Perches , Namhyung Kim , Linus Torvalds , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org On Sun, 23 Dec 2018 12:23:52 +0900 Masami Hiramatsu wrote: > On Sat, 22 Dec 2018 11:20:12 -0500 > Steven Rostedt wrote: > > > From: "Steven Rostedt (VMware)" > > > > There are several locations that compare constants to the beginning of > > string variables to determine what commands should be done, then the > > constant length is used to index into the string. This is error prone as the > > hard coded numbers have to match the size of the constants. Instead, use the > > len returned from str_has_prefix() and remove the open coded string length > > sizes. > > Looks good to me. > > Acked-by: Masami Hiramatsu > > for trace_probe part. Thanks Masami! -- Steve From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFB37C43387 for ; Sun, 23 Dec 2018 03:46:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF80B218D9 for ; Sun, 23 Dec 2018 03:46:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393086AbeLWDqf (ORCPT ); Sat, 22 Dec 2018 22:46:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:36418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389248AbeLWDqf (ORCPT ); Sat, 22 Dec 2018 22:46:35 -0500 Received: from vmware.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D72A21773; Sun, 23 Dec 2018 03:46:33 +0000 (UTC) Date: Sat, 22 Dec 2018 22:46:31 -0500 From: Steven Rostedt To: Masami Hiramatsu Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Joe Perches , Namhyung Kim , Linus Torvalds , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Subject: Re: [for-next][PATCH 5/5] tracing: Use the return of str_has_prefix() to remove open coded numbers Message-ID: <20181222224631.02e27c51@vmware.local.home> In-Reply-To: <20181223122352.dd3c077443f0b6621a796039@kernel.org> References: <20181222162007.697862256@goodmis.org> <20181222162857.116914355@goodmis.org> <20181223122352.dd3c077443f0b6621a796039@kernel.org> X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 23 Dec 2018 12:23:52 +0900 Masami Hiramatsu wrote: > On Sat, 22 Dec 2018 11:20:12 -0500 > Steven Rostedt wrote: > > > From: "Steven Rostedt (VMware)" > > > > There are several locations that compare constants to the beginning of > > string variables to determine what commands should be done, then the > > constant length is used to index into the string. This is error prone as the > > hard coded numbers have to match the size of the constants. Instead, use the > > len returned from str_has_prefix() and remove the open coded string length > > sizes. > > Looks good to me. > > Acked-by: Masami Hiramatsu > > for trace_probe part. Thanks Masami! -- Steve