From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 829F4AC1732 for ; Tue, 30 Jul 2024 15:08:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=uQAeFf/tA08w88s1K/CLlcKtPYYavqLiaGApNzKOsUQ=; c=relaxed/simple; d=groups.io; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1722352104; v=1; b=ZqMoMIZgarar+dfojR37pDsFP7Hwv4FUTe8mlpvHBFYJP2ye2lmyY4NfENgREuaxpDCLrh8b egmcqhY7CsjaCUSaSSn+j708pgfebC/OSb7WCzF9Gtvg6TMSrsh9Ail2tFnBhlOdnIIa+i15pvn //MIdgivb8SgPLAptrx3njb6p35ddHKXKtgoDuk+INhuvuz/zV3rnSKB25iqrPGJUJ3+Sbr60TM 3Abrj8lwD2s6it51UGie1hNLhmvvHvzyDsuTi6kNWf1M2fjZhzKNUa2gjupUOgsDxr//5MSC0cK ZbrYp7jiENLFddsNuWrgh70ho1QVZTvUp4bBpRBmv4nlQ== X-Received: by 127.0.0.2 with SMTP id fpo2YY7687511x3l2ZOIhUHD; Tue, 30 Jul 2024 08:08:23 -0700 X-Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by mx.groups.io with SMTP id smtpd.web10.42102.1722199491258483247 for ; Sun, 28 Jul 2024 13:44:51 -0700 X-Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-e03a544b9c8so2680375276.2 for ; Sun, 28 Jul 2024 13:44:51 -0700 (PDT) X-Gm-Message-State: LDqMkDQBWsNXCE8FydLz919Sx7686176AA= X-Google-Smtp-Source: AGHT+IFF/Lcy7+Tb9vMI9voFJCu4bkObHdFh+vwS7LmDAEuoWDBk21i2a0aewN9ue031mKr+uFJS4nUP X-Received: from palermo.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:118a]) (user=ardb job=sendgmr) by 2002:a05:6902:c04:b0:e0b:6a6a:e82 with SMTP id 3f1490d57ef6-e0b6a6a11c0mr7119276.2.1722199489936; Sun, 28 Jul 2024 13:44:49 -0700 (PDT) Date: Sun, 28 Jul 2024 22:44:31 +0200 In-Reply-To: <20240728204437.4064847-1-ardb+git@google.com> Mime-Version: 1.0 References: <20240728204437.4064847-1-ardb+git@google.com> Message-ID: <20240728204437.4064847-5-ardb+git@google.com> Subject: [edk2-devel] [PATCH edk2-platforms v2 4/8] Platform/RaspberryPi/VarBlockServiceDxe: Refactor DumpVars event handler From: "Ard Biesheuvel via groups.io" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Jeremy Linton Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Tue, 30 Jul 2024 08:08:17 -0700 Resent-From: ardb+git@google.com Reply-To: devel@edk2.groups.io,ardb+git@google.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=ZqMoMIZg; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io From: Ard Biesheuvel The DumpVars() routine is called directly and via an event notification callback, and the latter therefore defines the function's prototype, even though the arguments are unused. We will introduce another callback into this logic, but via a reset notifier, which has yet another prototype. So to keep things tidy, drop the formal parameters from DumpVars() and invoke it via a helper function that discards the arguments when called as a event notification callback. We will do the same for the reset notification once that functionality gets added. Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c index d7be37f67af3..006d4ded15e9 100644 --- a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c +++ b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c @@ -161,10 +161,8 @@ DoDump ( STATIC VOID -EFIAPI DumpVars ( - IN EFI_EVENT Event, - IN VOID *Context + VOID ) { EFI_STATUS Status; @@ -202,6 +200,16 @@ DumpVars ( mFvInstance->Dirty = FALSE; } +STATIC +VOID +EFIAPI +DumpVarsOnEvent ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + DumpVars (); +} VOID ReadyToBootHandler ( @@ -216,7 +224,7 @@ ReadyToBootHandler ( Status = gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, TPL_CALLBACK, - DumpVars, + DumpVarsOnEvent, NULL, &ImageInstallEvent ); @@ -229,7 +237,7 @@ ReadyToBootHandler ( ); ASSERT_EFI_ERROR (Status); - DumpVars (NULL, NULL); + DumpVars (); Status = gBS->CloseEvent (Event); ASSERT_EFI_ERROR (Status); } @@ -247,7 +255,7 @@ InstallDumpVarEventHandlers ( Status = gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL, TPL_CALLBACK, - DumpVars, + DumpVarsOnEvent, NULL, &gRaspberryPiEventResetGuid, &ResetEvent -- 2.46.0.rc1.232.g9752f9e123-goog -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120104): https://edk2.groups.io/g/devel/message/120104 Mute This Topic: https://groups.io/mt/107628978/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-