From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7780C433EF for ; Thu, 9 Dec 2021 13:39:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236301AbhLINmz (ORCPT ); Thu, 9 Dec 2021 08:42:55 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:40038 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236160AbhLINmz (ORCPT ); Thu, 9 Dec 2021 08:42:55 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 212E3B82410 for ; Thu, 9 Dec 2021 13:39:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07A02C004DD; Thu, 9 Dec 2021 13:39:17 +0000 (UTC) Date: Thu, 9 Dec 2021 13:39:14 +0000 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , Shuah Khan , Shuah Khan , Alan Hayward , Luis Machado , Salil Akerkar , Basant Kumar Dwivedi , Szabolcs Nagy , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v6 05/37] kselftest/arm64: Allow signal tests to trigger from a function Message-ID: References: <20211115152835.3212149-1-broonie@kernel.org> <20211115152835.3212149-6-broonie@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211115152835.3212149-6-broonie@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On Mon, Nov 15, 2021 at 03:28:03PM +0000, Mark Brown wrote: > Currently we have the facility to specify custom code to trigger a signal > but none of the tests use it and for some reason the framework requires us > to also specify a signal to send as a trigger in order to make use of a > custom trigger. This doesn't seem to make much sense, instead allow the > use of a custom trigger function without specifying a signal to inject. > > Signed-off-by: Mark Brown > --- > tools/testing/selftests/arm64/signal/test_signals_utils.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/arm64/signal/test_signals_utils.c b/tools/testing/selftests/arm64/signal/test_signals_utils.c > index 22722abc9dfa..8bb12be87a51 100644 > --- a/tools/testing/selftests/arm64/signal/test_signals_utils.c > +++ b/tools/testing/selftests/arm64/signal/test_signals_utils.c > @@ -310,7 +310,7 @@ int test_setup(struct tdescr *td) > > int test_run(struct tdescr *td) > { > - if (td->sig_trig) { > + if (td->sig_trig || td->trigger) { > if (td->trigger) > return td->trigger(td); > else I think we can write this with even less indentation: int test_run(struct tdescr *td) { if (td->trigger) return td->trigger(td); else if (td->sig_trig) return default_trigger(td); return td->run(td, NULL, NULL); } -- Catalin