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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 29AA5C433F5 for ; Thu, 6 Oct 2022 06:38:15 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C8D9B84D80; Thu, 6 Oct 2022 08:38:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="cnaKl7Kn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 72BC784903; Thu, 6 Oct 2022 08:38:10 +0200 (CEST) Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3EEE284D8B for ; Thu, 6 Oct 2022 08:38:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ej1-x62b.google.com with SMTP id a2so2302115ejx.10 for ; Wed, 05 Oct 2022 23:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=gHXjOYyvOimTB1EIeO4Nq+zKW+XlVoAcO81F5j9+slI=; b=cnaKl7Knq8HN2u1YHsa6xmZSD2bsG7jzIKVul31mP6k4l4NaKCOU7KRE5v46L3BU4D k2oj6PDltdXbNIxRe3WLYYoJTnLqLGAoYf4YDZKtj2xBUSnfpvhqbGRQ0rL75mkVoVeP z6hManF6++69hzXa/oaopReYIOSJlpie5ESIY8XcLl1HcUbkU3/dxI0c8yMD8u+QyV0C lXKyJiokbiDLr4zCx8OS3rusjr2+y6diaGAFIwc7VD/tx9oQUGrrLnFvXN6+CUXXkeud xNVajhI4SA6ys3sktSOxw+JJWsLWvaJgAIYtkcTzr4fyUKd/wcMW1/7FluOvKxG7Vb58 Y+Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=gHXjOYyvOimTB1EIeO4Nq+zKW+XlVoAcO81F5j9+slI=; b=a3yqKNjVLDaoh4/ntJCUCdlTNaVTPwU58V2fGDHPIgF3S8nsNdmeRTuUaaqdvKm7i+ NHGJw1HkuoIJHCrgSJSx0WgbSEYtLfPnJ4X7xSh1smsaWfBUcpGYswcKC2Jnjk9al+/g RoMzws+jqJ6xENgitTRwr8IRjHF3tVbOWsIkcw9kOizDS5L3OLu5mCrm/0POv+bDTc3k t5hSVeF+Sq61IoFqe/rWQWzDX8dXIdb0oZRCZ9MLTUv/q+XTZ3RtvKOjbhoYhMqwc6GE RQ8b5XOTaOt0Pkg3fOiAHp3gO1yPLh9866HXPqMqNeaVmajJS4Spdwzam+bExdNp0GdS fY/w== X-Gm-Message-State: ACrzQf28xXKnv1KzZzE0ZkP5ffAnyiiPDYrayVcIELsXELOTsQMyx5XQ vLPVG0Yz7V1T1ZeyJASZnkQaWDSt8lejfQ== X-Google-Smtp-Source: AMsMyM7oqP1ugmxwN1qSBLLMSzRJg7I+pLctNEMOPah68r+oWagA9iQDwRuG4W6IF+FTHDoyjZfz1w== X-Received: by 2002:a17:907:ea6:b0:782:1ace:9d5b with SMTP id ho38-20020a1709070ea600b007821ace9d5bmr2604845ejc.770.1665038283467; Wed, 05 Oct 2022 23:38:03 -0700 (PDT) Received: from hera (ppp046103015185.access.hol.gr. [46.103.15.185]) by smtp.gmail.com with ESMTPSA id 18-20020a170906211200b0077077b59085sm9802179ejt.184.2022.10.05.23.38.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 23:38:03 -0700 (PDT) Date: Thu, 6 Oct 2022 09:38:01 +0300 From: Ilias Apalodimas To: Heinrich Schuchardt Cc: u-boot@lists.denx.de Subject: Re: [PATCH 2/3] efi_selftest: rename event_notify Message-ID: References: <20221006054933.47004-1-heinrich.schuchardt@canonical.com> <20221006054933.47004-3-heinrich.schuchardt@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221006054933.47004-3-heinrich.schuchardt@canonical.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On Thu, Oct 06, 2022 at 07:49:32AM +0200, Heinrich Schuchardt wrote: > A function event_notify() exists. We should not use the same name for and > EFI event. Rename events in unit tests. > > Signed-off-by: Heinrich Schuchardt > --- > lib/efi_selftest/efi_selftest_events.c | 18 +++---- > .../efi_selftest_exitbootservices.c | 6 +-- > lib/efi_selftest/efi_selftest_tpl.c | 47 ++++++++++--------- > lib/efi_selftest/efi_selftest_watchdog.c | 30 ++++++------ > 4 files changed, 55 insertions(+), 46 deletions(-) > > diff --git a/lib/efi_selftest/efi_selftest_events.c b/lib/efi_selftest/efi_selftest_events.c > index 90071536a2..743a6b9154 100644 > --- a/lib/efi_selftest/efi_selftest_events.c > +++ b/lib/efi_selftest/efi_selftest_events.c > @@ -11,7 +11,7 @@ > > #include > > -static struct efi_event *event_notify; > +static struct efi_event *efi_st_event_notify; > static struct efi_event *event_wait; > static unsigned int timer_ticks; > static struct efi_boot_services *boottime; > @@ -50,7 +50,7 @@ static int setup(const efi_handle_t handle, > > ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_SIGNAL, > TPL_CALLBACK, notify, (void *)&timer_ticks, > - &event_notify); > + &efi_st_event_notify); > if (ret != EFI_SUCCESS) { > efi_st_error("could not create event\n"); > return EFI_ST_FAILURE; > @@ -75,9 +75,9 @@ static int teardown(void) > { > efi_status_t ret; > > - if (event_notify) { > - ret = boottime->close_event(event_notify); > - event_notify = NULL; > + if (efi_st_event_notify) { > + ret = boottime->close_event(efi_st_event_notify); > + efi_st_event_notify = NULL; > if (ret != EFI_SUCCESS) { > efi_st_error("could not close event\n"); > return EFI_ST_FAILURE; > @@ -112,7 +112,8 @@ static int execute(void) > > /* Set 10 ms timer */ > timer_ticks = 0; > - ret = boottime->set_timer(event_notify, EFI_TIMER_PERIODIC, 100000); > + ret = boottime->set_timer(efi_st_event_notify, EFI_TIMER_PERIODIC, > + 100000); > if (ret != EFI_SUCCESS) { > efi_st_error("Could not set timer\n"); > return EFI_ST_FAILURE; > @@ -146,14 +147,15 @@ static int execute(void) > efi_st_error("Incorrect timing of events\n"); > return EFI_ST_FAILURE; > } > - ret = boottime->set_timer(event_notify, EFI_TIMER_STOP, 0); > + ret = boottime->set_timer(efi_st_event_notify, EFI_TIMER_STOP, 0); > if (ret != EFI_SUCCESS) { > efi_st_error("Could not cancel timer\n"); > return EFI_ST_FAILURE; > } > /* Set 10 ms timer */ > timer_ticks = 0; > - ret = boottime->set_timer(event_notify, EFI_TIMER_RELATIVE, 100000); > + ret = boottime->set_timer(efi_st_event_notify, EFI_TIMER_RELATIVE, > + 100000); > if (ret != EFI_SUCCESS) { > efi_st_error("Could not set timer\n"); > return EFI_ST_FAILURE; > diff --git a/lib/efi_selftest/efi_selftest_exitbootservices.c b/lib/efi_selftest/efi_selftest_exitbootservices.c > index f5e0d9da89..11b43fdd90 100644 > --- a/lib/efi_selftest/efi_selftest_exitbootservices.c > +++ b/lib/efi_selftest/efi_selftest_exitbootservices.c > @@ -26,7 +26,7 @@ struct notification_context { > }; > > static struct efi_boot_services *boottime; > -static struct efi_event *event_notify; > +static struct efi_event *efi_st_event_notify; > struct notification_record record; > > struct notification_context context_before = { > @@ -75,7 +75,7 @@ static int setup(const efi_handle_t handle, > ret = boottime->create_event(EVT_SIGNAL_EXIT_BOOT_SERVICES, > TPL_CALLBACK, ebs_notify, > &context, > - &event_notify); > + &efi_st_event_notify); > if (ret != EFI_SUCCESS) { > efi_st_error("could not create event\n"); > return EFI_ST_FAILURE; > @@ -83,7 +83,7 @@ static int setup(const efi_handle_t handle, > ret = boottime->create_event_ex(0, TPL_CALLBACK, ebs_notify, > &context_before, > &guid_before_exit_boot_services, > - &event_notify); > + &efi_st_event_notify); > if (ret != EFI_SUCCESS) { > efi_st_error("could not create event\n"); > return EFI_ST_FAILURE; > diff --git a/lib/efi_selftest/efi_selftest_tpl.c b/lib/efi_selftest/efi_selftest_tpl.c > index f4e467267e..909c78a1c2 100644 > --- a/lib/efi_selftest/efi_selftest_tpl.c > +++ b/lib/efi_selftest/efi_selftest_tpl.c > @@ -10,8 +10,8 @@ > > #include > > -static struct efi_event *event_notify; > -static struct efi_event *event_wait; > +static struct efi_event *efi_st_event_notify; > +static struct efi_event *efi_st_event_wait; > static unsigned int notification_count; > static struct efi_boot_services *boottime; > > @@ -49,13 +49,14 @@ static int setup(const efi_handle_t handle, > ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_SIGNAL, > TPL_CALLBACK, notify, > (void *)¬ification_count, > - &event_notify); > + &efi_st_event_notify); > if (ret != EFI_SUCCESS) { > efi_st_error("could not create event\n"); > return EFI_ST_FAILURE; > } > ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_WAIT, > - TPL_NOTIFY, notify, NULL, &event_wait); > + TPL_NOTIFY, notify, NULL, > + &efi_st_event_wait); > if (ret != EFI_SUCCESS) { > efi_st_error("could not create event\n"); > return EFI_ST_FAILURE; > @@ -74,17 +75,17 @@ static int teardown(void) > { > efi_status_t ret; > > - if (event_notify) { > - ret = boottime->close_event(event_notify); > - event_notify = NULL; > + if (efi_st_event_notify) { > + ret = boottime->close_event(efi_st_event_notify); > + efi_st_event_notify = NULL; > if (ret != EFI_SUCCESS) { > efi_st_error("could not close event\n"); > return EFI_ST_FAILURE; > } > } > - if (event_wait) { > - ret = boottime->close_event(event_wait); > - event_wait = NULL; > + if (efi_st_event_wait) { > + ret = boottime->close_event(efi_st_event_wait); > + efi_st_event_wait = NULL; > if (ret != EFI_SUCCESS) { > efi_st_error("could not close event\n"); > return EFI_ST_FAILURE; > @@ -116,24 +117,26 @@ static int execute(void) > > /* Set 10 ms timer */ > notification_count = 0; > - ret = boottime->set_timer(event_notify, EFI_TIMER_PERIODIC, 100000); > + ret = boottime->set_timer(efi_st_event_notify, EFI_TIMER_PERIODIC, > + 100000); > if (ret != EFI_SUCCESS) { > efi_st_error("Could not set timer\n"); > return EFI_ST_FAILURE; > } > /* Set 100 ms timer */ > - ret = boottime->set_timer(event_wait, EFI_TIMER_RELATIVE, 1000000); > + ret = boottime->set_timer(efi_st_event_wait, EFI_TIMER_RELATIVE, > + 1000000); > if (ret != EFI_SUCCESS) { > efi_st_error("Could not set timer\n"); > return EFI_ST_FAILURE; > } > index = 5; > - ret = boottime->wait_for_event(1, &event_wait, &index); > + ret = boottime->wait_for_event(1, &efi_st_event_wait, &index); > if (ret != EFI_SUCCESS) { > efi_st_error("Could not wait for event\n"); > return EFI_ST_FAILURE; > } > - ret = boottime->check_event(event_wait); > + ret = boottime->check_event(efi_st_event_wait); > if (ret != EFI_NOT_READY) { > efi_st_error("Signaled state was not cleared.\n"); > efi_st_printf("ret = %u\n", (unsigned int)ret); > @@ -150,7 +153,7 @@ static int execute(void) > efi_st_error("Incorrect timing of events\n"); > return EFI_ST_FAILURE; > } > - ret = boottime->set_timer(event_notify, EFI_TIMER_STOP, 0); > + ret = boottime->set_timer(efi_st_event_notify, EFI_TIMER_STOP, 0); > if (ret != EFI_SUCCESS) { > efi_st_error("Could not cancel timer\n"); > return EFI_ST_FAILURE; > @@ -163,19 +166,21 @@ static int execute(void) > } > /* Set 10 ms timer */ > notification_count = 0; > - ret = boottime->set_timer(event_notify, EFI_TIMER_PERIODIC, 100000); > + ret = boottime->set_timer(efi_st_event_notify, EFI_TIMER_PERIODIC, > + 100000); > if (ret != EFI_SUCCESS) { > efi_st_error("Could not set timer\n"); > return EFI_ST_FAILURE; > } > /* Set 100 ms timer */ > - ret = boottime->set_timer(event_wait, EFI_TIMER_RELATIVE, 1000000); > + ret = boottime->set_timer(efi_st_event_wait, EFI_TIMER_RELATIVE, > + 1000000); > if (ret != EFI_SUCCESS) { > efi_st_error("Could not set timer\n"); > return EFI_ST_FAILURE; > } > do { > - ret = boottime->check_event(event_wait); > + ret = boottime->check_event(efi_st_event_wait); > } while (ret == EFI_NOT_READY); > if (ret != EFI_SUCCESS) { > efi_st_error("Could not check event\n"); > @@ -189,14 +194,14 @@ static int execute(void) > return EFI_ST_FAILURE; > } > /* Set 1 ms timer */ > - ret = boottime->set_timer(event_wait, EFI_TIMER_RELATIVE, 1000); > + ret = boottime->set_timer(efi_st_event_wait, EFI_TIMER_RELATIVE, 1000); > if (ret != EFI_SUCCESS) { > efi_st_error("Could not set timer\n"); > return EFI_ST_FAILURE; > } > /* Restore the old TPL level */ > boottime->restore_tpl(TPL_APPLICATION); > - ret = boottime->wait_for_event(1, &event_wait, &index); > + ret = boottime->wait_for_event(1, &efi_st_event_wait, &index); > if (ret != EFI_SUCCESS) { > efi_st_error("Could not wait for event\n"); > return EFI_ST_FAILURE; > @@ -208,7 +213,7 @@ static int execute(void) > efi_st_error("Queued timer event did not fire\n"); > return EFI_ST_FAILURE; > } > - ret = boottime->set_timer(event_wait, EFI_TIMER_STOP, 0); > + ret = boottime->set_timer(efi_st_event_wait, EFI_TIMER_STOP, 0); > if (ret != EFI_SUCCESS) { > efi_st_error("Could not cancel timer\n"); > return EFI_ST_FAILURE; > diff --git a/lib/efi_selftest/efi_selftest_watchdog.c b/lib/efi_selftest/efi_selftest_watchdog.c > index a352d4a5ad..4d7ed5a54b 100644 > --- a/lib/efi_selftest/efi_selftest_watchdog.c > +++ b/lib/efi_selftest/efi_selftest_watchdog.c > @@ -28,8 +28,8 @@ struct notify_context { > unsigned int timer_ticks; > }; > > -static struct efi_event *event_notify; > -static struct efi_event *event_wait; > +static struct efi_event *efi_st_event_notify; > +static struct efi_event *efi_st_event_wait; > static struct efi_boot_services *boottime; > static struct notify_context notification_context; > static bool watchdog_reset; > @@ -79,13 +79,14 @@ static int setup(const efi_handle_t handle, > ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_SIGNAL, > TPL_CALLBACK, notify, > (void *)¬ification_context, > - &event_notify); > + &efi_st_event_notify); > if (ret != EFI_SUCCESS) { > efi_st_error("could not create event\n"); > return EFI_ST_FAILURE; > } > ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_WAIT, > - TPL_CALLBACK, notify, NULL, &event_wait); > + TPL_CALLBACK, notify, NULL, > + &efi_st_event_wait); > if (ret != EFI_SUCCESS) { > efi_st_error("could not create event\n"); > return EFI_ST_FAILURE; > @@ -138,17 +139,17 @@ static int teardown(void) > efi_st_error("Setting watchdog timer failed\n"); > return EFI_ST_FAILURE; > } > - if (event_notify) { > - ret = boottime->close_event(event_notify); > - event_notify = NULL; > + if (efi_st_event_notify) { > + ret = boottime->close_event(efi_st_event_notify); > + efi_st_event_notify = NULL; > if (ret != EFI_SUCCESS) { > efi_st_error("Could not close event\n"); > return EFI_ST_FAILURE; > } > } > - if (event_wait) { > - ret = boottime->close_event(event_wait); > - event_wait = NULL; > + if (efi_st_event_wait) { > + ret = boottime->close_event(efi_st_event_wait); > + efi_st_event_wait = NULL; > if (ret != EFI_SUCCESS) { > efi_st_error("Could not close event\n"); > return EFI_ST_FAILURE; > @@ -181,21 +182,22 @@ static int execute(void) > } > if (watchdog_reset) { > /* Set 600 ms timer */ > - ret = boottime->set_timer(event_notify, EFI_TIMER_PERIODIC, > - 6000000); > + ret = boottime->set_timer(efi_st_event_notify, > + EFI_TIMER_PERIODIC, 6000000); > if (ret != EFI_SUCCESS) { > efi_st_error("Could not set timer\n"); > return EFI_ST_FAILURE; > } > } > /* Set 1350 ms timer */ > - ret = boottime->set_timer(event_wait, EFI_TIMER_RELATIVE, 13500000); > + ret = boottime->set_timer(efi_st_event_wait, EFI_TIMER_RELATIVE, > + 13500000); > if (ret != EFI_SUCCESS) { > efi_st_error("Could not set timer\n"); > return EFI_ST_FAILURE; > } > > - ret = boottime->wait_for_event(1, &event_wait, &index); > + ret = boottime->wait_for_event(1, &efi_st_event_wait, &index); > if (ret != EFI_SUCCESS) { > efi_st_error("Could not wait for event\n"); > return EFI_ST_FAILURE; > -- > 2.37.2 > Reviewed-by: Ilias Apalodimas