Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1234928imm; Tue, 5 Jun 2018 11:07:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJpyzDKmBLBVE7rVwX2FyyG3Hb8zL+j/AqtoxFfCVZQ2NtwCSC8O0SOi0Z/UEMLd/Qk/fLB X-Received: by 2002:a62:e903:: with SMTP id j3-v6mr26964504pfh.196.1528222020921; Tue, 05 Jun 2018 11:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528222020; cv=none; d=google.com; s=arc-20160816; b=YVQBr9E50ZLWMDkfnvoQpizijqyvQdmktNcMWtUATFjXPXh5v01KUpJ3JJtMbJiZZc GMXmo/SoTi4A0qJvO3ZyUCPDABjQ/pFSq+YVoLjG8uVmAuNE4cCNuXbN3G/QQbPOM4et FDMsO85oaet7gm+stF/isosGXvd9xOY1FWz8Cs1Wg7q9LOkGzTJ72M8boixlQoN89ShB ySVJYkH97LHClp6iUgmzuggRayDn5IlfCd1VsP62q747Kc91hHLEKtpslhY8CC8udveX RmRdWmhP1IiwOe4F6dYRYduruFHtE9Apvdv4f8AwjUhpAfcHqluUSgij/BKQuuyT7OjR nTQg== 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:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=R1mDibvkx6VTlofxJKqyAh1zVfYYjfxGAsvOgg5mlY8=; b=xSOedLws5UWWoKniYU4UcbZp1VKWOVdOjUdNZbyCbex2VciiMivgHwriCgsc6DCJQT e7zbfdSUeA4efHTySpfDv7eLcIfIXuQ51+FE5vbrNrW6kfDA01vuiwfwGQZytTgXsgRx qYzo3KzAcTiMVX5y9R++91F7iuBZJFwxXdxEjUl2rnRRV835lb3V6CgsfZZB6A9e+T1o UWQnWtMG3p1zke0QaQ2rrdOAlaXNd5svUFn86bsgQ0t9vbZgoBMiMOVGmOyDIP8f+cCm 3GgoVp4HTFcYU+wmuzGu7L2JLV/K4XZQi9HvtrxI3kS8UhO/EpbRj06EdiPToBq6t8ru p+2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tieWkBj5; 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 u191-v6si23940368pgd.667.2018.06.05.11.06.46; Tue, 05 Jun 2018 11:07:00 -0700 (PDT) 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=tieWkBj5; 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 S1752011AbeFERuw (ORCPT + 99 others); Tue, 5 Jun 2018 13:50:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:45312 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751852AbeFERus (ORCPT ); Tue, 5 Jun 2018 13:50:48 -0400 Received: from jouet.infradead.org (unknown [179.97.41.186]) (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 1AC602083B; Tue, 5 Jun 2018 17:50:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528221047; bh=x+gYMLjgE7HngZvD1J1eftU6Gy9B+uIoxAEUZwLXNBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tieWkBj5j8E5qbmWBF6FdqahWOd1nxGxWIYiTRbvrnNLSEGBy1WYEibudeDMbHhNk SRJ0hFKIVXpO4C9Bc5SqbgFsggR8N0eYHxD8yoVAE0VVSTYkhoIcLfK2fDUCnRb1hV ZTcD3lvaRheI/mhTICqifOYKeSEBRMM4JS03QVJY= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter , David Ahern , Jiri Olsa , Masami Hiramatsu , Namhyung Kim , Wang Nan Subject: [PATCH 02/46] perf probe: Use return of map__get() to make code more compact Date: Tue, 5 Jun 2018 14:49:46 -0300 Message-Id: <20180605175030.32549-3-acme@kernel.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180605175030.32549-1-acme@kernel.org> References: <20180605175030.32549-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo The __get() idiom returns a reference count for the object passed, i.e. all functions of this type return the object passed, so take advantage of that to make the code more compact. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-ds6vdm7clh070512rpydidsc@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/probe-event.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 3094f11e7d81..f119eb628dbb 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -165,8 +165,7 @@ static struct map *kernel_get_module_map(const char *module) if (strncmp(pos->dso->short_name + 1, module, pos->dso->short_name_len - 2) == 0 && module[pos->dso->short_name_len - 2] == '\0') { - map__get(pos); - return pos; + return map__get(pos); } } return NULL; -- 2.14.3