Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754808AbbGFLlk (ORCPT ); Mon, 6 Jul 2015 07:41:40 -0400 Received: from mail4.hitachi.co.jp ([133.145.228.5]:46461 "EHLO mail4.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754775AbbGFLlj (ORCPT ); Mon, 6 Jul 2015 07:41:39 -0400 X-Greylist: delayed 1013 seconds by postgrey-1.27 at vger.kernel.org; Mon, 06 Jul 2015 07:41:38 EDT Message-ID: <559A696C.4030704@hitachi.com> Date: Mon, 06 Jul 2015 20:41:32 +0900 From: Masami Hiramatsu Organization: Hitachi, Ltd., Japan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: SF Markus Elfring , Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: Re: [PATCH] perf probe: Delete an unnecessary check before the function call "strfilter__delete" References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <546A2C5C.8080800@users.sourceforge.net> <5597751A.5000506@users.sourceforge.net> In-Reply-To: <5597751A.5000506@users.sourceforge.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1575 Lines: 47 On 2015/07/04 14:54, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sat, 4 Jul 2015 07:44:22 +0200 > > The strfilter__delete() function tests whether its argument is NULL and > then returns immediately. Thus the test around the call is not needed. > > This issue was detected by using the Coccinelle software. > This looks OK for me. Acked-by: Masami Hiramatsu > Signed-off-by: Markus Elfring > --- > tools/perf/builtin-probe.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c > index 1272559..b81cec3 100644 > --- a/tools/perf/builtin-probe.c > +++ b/tools/perf/builtin-probe.c > @@ -297,8 +297,7 @@ static void cleanup_params(void) > clear_perf_probe_event(params.events + i); > line_range__clear(¶ms.line_range); > free(params.target); > - if (params.filter) > - strfilter__delete(params.filter); > + strfilter__delete(params.filter); > memset(¶ms, 0, sizeof(params)); > } > > -- Masami HIRAMATSU Linux Technology Research Center, System Productivity Research Dept. Center for Technology Innovation - Systems Engineering Hitachi, Ltd., Research & Development Group E-mail: masami.hiramatsu.pt@hitachi.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/