From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751361AbdISNeD (ORCPT ); Tue, 19 Sep 2017 09:34:03 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:50248 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750973AbdISNeC (ORCPT ); Tue, 19 Sep 2017 09:34:02 -0400 Date: Tue, 19 Sep 2017 14:32:37 +0100 From: Mark Rutland To: Andrey Ryabinin Cc: Dmitry Vyukov , akpm@linux-foundation.org, Andrey Konovalov , tchibo@google.com, syzkaller@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] kcov: remove pointless current != NULL check Message-ID: <20170919133237.GF30715@leverpostej> References: <20170919124648.28963-1-aryabinin@virtuozzo.com> <20170919124648.28963-2-aryabinin@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170919124648.28963-2-aryabinin@virtuozzo.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 19, 2017 at 03:46:47PM +0300, Andrey Ryabinin wrote: > __sanitizer_cov_trace_pc() is a hot code, so it's worth > to remove pointless '!current' check. Current is never NULL. > > Signed-off-by: Andrey Ryabinin Acked-by: Mark Rutland Thanks, Mark. > --- > kernel/kcov.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/kcov.c b/kernel/kcov.c > index 2f0e7a7c7afc..14cc8c1a7cad 100644 > --- a/kernel/kcov.c > +++ b/kernel/kcov.c > @@ -61,7 +61,7 @@ void notrace __sanitizer_cov_trace_pc(void) > * We are interested in code coverage as a function of a syscall inputs, > * so we ignore code executed in interrupts. > */ > - if (!t || !in_task()) > + if (!in_task()) > return; > mode = READ_ONCE(t->kcov_mode); > if (mode == KCOV_MODE_TRACE) { > -- > 2.13.5 >