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=-1.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 531DAC43387 for ; Wed, 19 Dec 2018 20:38:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 127222086C for ; Wed, 19 Dec 2018 20:38:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545251923; bh=RdYtcIxgR5cVtKimc93Liz4bgZFOm7q8AYNlF1L3FPw=; h=Subject:From:To:Cc:Date:In-Reply-To:References:List-ID:From; b=CJDoK2+kazrkL5L2p0vqsEKbJ0J+kva2KoqA62aEQTNpSmOn9rXOtW6bYSimciC8E /7wJu788A222Hmq/G+iNdqj5icLTMvje2pOZoXo1wd0MnQgbkBQmVjUiQUfvDvNeVl WpJtFeNnK3eWB9e6HRdIpts+rfbk1HrKkH49EYJk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730262AbeLSUim (ORCPT ); Wed, 19 Dec 2018 15:38:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:41684 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725294AbeLSUim (ORCPT ); Wed, 19 Dec 2018 15:38:42 -0500 Received: from tzanussi-mobl (c-98-220-238-81.hsd1.il.comcast.net [98.220.238.81]) (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 8D34920815; Wed, 19 Dec 2018 20:38:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545251921; bh=RdYtcIxgR5cVtKimc93Liz4bgZFOm7q8AYNlF1L3FPw=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=lpb3QdM1G+SVnwQp/KqhILUmH0zthJTtBRGFxXK/wLzmjc/NsHP+KYExaRTXCLUh/ 8+hRc+uLIboVC8ShcvUWAkWxRuA9YOJa+yhhPDnQhSSgi9yNNJttB9qysikKpYUOzN Wl/ygNmChdRxfmmoTXWU7VuYP908K23YLcvhLgMA= Message-ID: <1545251919.4161.4.camel@kernel.org> Subject: Re: [PATCH 2/7] tracing: Change strlen to sizeof for hist trigger static strings From: Tom Zanussi To: Steven Rostedt , Joe Perches Cc: tglx@linutronix.de, mhiramat@kernel.org, namhyung@kernel.org, vedang.patel@intel.com, bigeasy@linutronix.de, joel@joelfernandes.org, mathieu.desnoyers@efficios.com, julia@ni.com, linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org Date: Wed, 19 Dec 2018 14:38:39 -0600 In-Reply-To: <20181219153002.62ede7e9@gandalf.local.home> References: <20181219144047.49fabfa6@gandalf.local.home> <1545248809.2396.2.camel@kernel.org> <20181219153002.62ede7e9@gandalf.local.home> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-12-19 at 15:30 -0500, Steven Rostedt wrote: > On Wed, 19 Dec 2018 12:20:19 -0800 > Joe Perches wrote: > > > > Yeah, I had considered it but wasn't sure it was worth it. Since > > > you're suggesting it is, I can send another patch on top of > > > these, or > > > feel free if you want to too. ;-) > > > > I believe the 'strlen("foo") -> sizeof("foo") - 1' > > conversions do not change objects at all. > > > > strlen("constant") is already optimized by gcc to a > > constant value when fed a constant string. > > If that's the case (and it probably is), then yeah, strlen is > probably > better. As it can handle the "not a constant" that you stated in > another email. > OK, so I guess that means we should just drop this patch ('[PATCH 2/7] tracing: Change strlen to sizeof for hist trigger static strings'). Tom > -- Steve > > > > > > the strcmp_const macro does seem to make sense as > > the copy/paste/typo possibility is real. > >