Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp709376imu; Wed, 16 Jan 2019 06:23:58 -0800 (PST) X-Google-Smtp-Source: ALg8bN5cTkVG5MX7K49iH22GdchHW+kmqrQrFavdQTfA/iZnM0lXf4NhnZAPDh90KDSdna0WQLmR X-Received: by 2002:a62:1c0a:: with SMTP id c10mr9990795pfc.213.1547648638584; Wed, 16 Jan 2019 06:23:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547648638; cv=none; d=google.com; s=arc-20160816; b=LKAh0guJjsbSmnEIYb05AKvkLWAFUs0AL3EhdTA3GjGZUX5dK9vGqu/N0TNTyic7iz UFyZzhegjfyYksUVH0e4CTi4kBUcHWX3TYZzy6EdLXa3UWnHGQOUO/+9MruJcZ3R428A JFzAdDl6XWCqkl4QKWT42vCxsgOrGLScwyLIHkCgNTYCrT5ioMZs2eM6UnUOjmfNygwS ztyOkiSS+AhwtoMPOSzqR+sZRaJPFpp50Y0lK4SKyxcg2FAaqjOX6OVdKyDi/K8/WBKR 1+PaRm1MRzObgO7E+jgNLSivQYmW2Y7kjSnf53BXutHFHbcpqsL65Dhk6KgQ1W30p+YE gl4Q== 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=tl9VPQJJAXXqk2WRk72BhllFQsEgKYjqOfftPz/nn6g=; b=PqArKdWv2/ZMKwY7o71/sdGOPkJPIFNNUJNCt3OivBk/rdiQYdcpij0cb+dBqDqeTb MG8d3HHqY27SEabTzTCWxJoOh4KiXUoC8gW/7rBFEMjiR8f0vTtKOgP2AKDZoYFk0BlV sPpn/kkXNE/NU/qMgLhPkKlCG7eGfKUjH+qazgJk1NVUdRmtf9xi8ztPEd41uYfkwe/A vTIuF5JO0lX+2Fu8yyF12+xhTjWxzOIG3qsW+lh+JkPVw6pGAU71fJxi7J4+DtzRykts mEMWST/fuE+8KlUbdzCoRi4xBFRY4wBcbm0s2JWB7rAgcWJLwNjJYZm+2YOj+wrotytn uUIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Rhpf545a; 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 a19si6129919pgj.429.2019.01.16.06.23.39; Wed, 16 Jan 2019 06:23:58 -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=Rhpf545a; 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 S2390877AbfAOWGK (ORCPT + 99 others); Tue, 15 Jan 2019 17:06:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:49072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390702AbfAOWGK (ORCPT ); Tue, 15 Jan 2019 17:06:10 -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 B875920896; Tue, 15 Jan 2019 22:06:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547589969; bh=iojhO78N/cfaFgOxdfWDUOBTLjJLdExL10gLTcBKJNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=Rhpf545a/rKe5zEBiGmLYtilUhXEQ6DPVu1sScHQXuFZ5tluDzkHUwIQwWJTpcz3M AgjhDuU3CgVbZtf7cChlfoXNyBJj75vOKwZgydhEUmWf4Lz3oJD6mcE/fIRBdjtp11 WJ2wqvacT7zWsTfgDsB1dAWPR63xNWApsV2e1l9Q= From: Tom Zanussi To: rostedt@goodmis.org 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 Subject: [PATCH v12 01/16] tracing: Use str_has_prefix() in synth_event_create() Date: Tue, 15 Jan 2019 16:05:45 -0600 Message-Id: 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 --- kernel/trace/trace_events_hist.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 449d90cfa151..625725ae262f 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -1200,8 +1200,7 @@ 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)) + if ((len = str_has_prefix(name, SYNTH_SYSTEM "/")) == 0) return -EINVAL; name += len; } -- 2.14.1