Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp4295948ima; Mon, 4 Feb 2019 13:51:31 -0800 (PST) X-Google-Smtp-Source: AHgI3IYQo9NBuJGRHWCnwYnA6108SCSNZnWyEZ3YLJ8sijvgKApaOItYfkG2HHbn3h6qJAhT3eR9 X-Received: by 2002:a63:1f4e:: with SMTP id q14mr1374664pgm.88.1549317091370; Mon, 04 Feb 2019 13:51:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549317091; cv=none; d=google.com; s=arc-20160816; b=DA13xDz7cQfdj57UOv3W6gPk5+nFLbvOFNnuMbrm31YsOxCIjVF9m9UulW7fQ+TIZv 7M1CUftCLeglVlrjaZYE4GL89F+CTsVemYV9LeRa+7QgXt1UdBRvDeQWNd7j446ushR2 /kBCih2VabsQ41X+SOEvsxE8ENh/oqLhM8yjSMkYr0paPkR2hSg9SGxAaWyNfqxHuNIn ZN7+As+UrUliP2QOL9ZhRFzAO9hBks9KQTfU560ABIuFddn119EDBszEC895ewWzucqa 5t5YkWrSf/ZsFbAbInt3ikxfMnfdhNthaeL1tk7iZXvQrcJ919UI4Qc8RGstQ4B/srtv 8zOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=KUv+6JsA+xiAq8XTdC4xSkG/RQZF2sYQ8BRgNLNDwNg=; b=jJ9PfYkDZtacqLI7xQxKcS0eAmfhJCcy98r0WRSPE/qbbhqRNw1sYIZRxuWZDVRAIk XIhtPE27Tc9EJciYPF3jguihM3xXCzcj1cCuARUuIr/ADjs7EgsDnuNNnS+Y0fy1JTH0 Ya6WeguFEUx79XAENtDNAYK8EA3+Up4i1dWScxd2dAg6WOO1dBywJSPYrsibySubjce5 TRvBz3xrvjIpuco/VFFiYiIoGMto1VNP5qtGzwXYemGdsUlSNVWEegPiHliEfEyyVGhj 4PngvR22km5ofrpqUkzmNwHW7g0l5bCpxhHxKH5BkQolHs3WRF44CWnaGbCTW1U3Uq54 NzDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AeEGIThe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r185si197151pgr.245.2019.02.04.13.51.15; Mon, 04 Feb 2019 13:51:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AeEGIThe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729941AbfBDVHi (ORCPT + 99 others); Mon, 4 Feb 2019 16:07:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:32918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728004AbfBDVHd (ORCPT ); Mon, 4 Feb 2019 16:07:33 -0500 Received: from localhost.localdomain (c-98-220-238-81.hsd1.il.comcast.net [98.220.238.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C15252082E; Mon, 4 Feb 2019 21:07:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549314453; bh=awcOFxXuAB7snDuDrXhqyOS89kVZGjIAerQumthlT+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=AeEGIThexPWAv3KZRfIjqQezZdY+cydXQd54QFrf0a2CzF7Wspj1QgyZAXzKqrD3G iylF4/lHtCQeXAM6VUrT0EJB/wej6QluXOI8D2OHuleWbZpaQEa6eG8pezqn4lmb1w AryA0uNuoXZts6erimzMtV7XCPoSFggdVUFTPumE= From: Tom Zanussi To: rostedt@goodmis.org Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, Tom Zanussi , Joe Perches Subject: [PATCH 1/2] tracing: Use str_has_prefix() in synth_event_create() Date: Mon, 4 Feb 2019 15:07:23 -0600 Message-Id: <03418373fd1e80030e7394b8e3e081c5de28a710.1549309756.git.tom.zanussi@linux.intel.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tom Zanussi Since we now have a str_has_prefix() that returns the length, we can use that instead of explicitly calculating it. Signed-off-by: Tom Zanussi Cc: Joe Perches --- kernel/trace/trace_events_hist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 449d90cfa151..c4a667503bf0 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -1200,8 +1200,8 @@ static int synth_event_create(int argc, const char **argv) /* This interface accepts group name prefix */ if (strchr(name, '/')) { - len = sizeof(SYNTH_SYSTEM "/") - 1; - if (strncmp(name, SYNTH_SYSTEM "/", len)) + len = str_has_prefix(name, SYNTH_SYSTEM "/"); + if (len == 0) return -EINVAL; name += len; } -- 2.14.1