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 6E376AC14DF for ; Tue, 30 Jul 2024 15:08:17 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=6YoMHzzcENcZzI2qg7NvkZ1bCSeu8CVsPVTS5QoqqLo=; 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=1722352097; v=1; b=Vl59oZxnsvC7DiGZrmGiXdngGSSAfI5v4utfy8MLqLdRGJh/1K3+cx/asgDlNYdnGCopXAF0 h7/ckGWoDjGkwJspsQ/bSV62n4Apeu3oX0T6z1nfUWSwXz/q5Y+wzM0Cgm1MVm3UBobjiwhjIj+ 8zVdVzvbGhfie3gnX4CInsJPrCENymu4cwnI3K2IRIo6rdSlkUVGUc60QeRxBM/JcDE2MITxHr5 pn4EcsqZoK9FHFtwRtJf5hPibWvwU5dhJrLDVOR2sFjUxIBTPpn8jy9ZdDuc0DShNmvR1cYFHvj YwpdwGe9cLRk2xbb1uJFj4lJv8853fMPm6UftOMY7aEeA== X-Received: by 127.0.0.2 with SMTP id 38enYY7687511xi1wIIFhL7F; Tue, 30 Jul 2024 08:08:15 -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.web11.33577.1721904221734840197 for ; Thu, 25 Jul 2024 03:43:41 -0700 X-Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-e03a5534d58so1346435276.1 for ; Thu, 25 Jul 2024 03:43:41 -0700 (PDT) X-Gm-Message-State: ARub3CI96j4bnhqypq1NMSYdx7686176AA= X-Google-Smtp-Source: AGHT+IFBhsKD78kXMPS+bGgMIhS8hmRVDuvPtcK+wWdN4+QHIJz0vvzpxSg9OvEFdClR7l8nZWzbUKtr X-Received: from palermo.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:118a]) (user=ardb job=sendgmr) by 2002:a05:6902:c08:b0:de5:3003:4b64 with SMTP id 3f1490d57ef6-e0b2300ca28mr3940276.1.1721904220166; Thu, 25 Jul 2024 03:43:40 -0700 (PDT) Date: Thu, 25 Jul 2024 12:43:26 +0200 In-Reply-To: <20240725104332.1675625-1-ardb+git@google.com> Mime-Version: 1.0 References: <20240725104332.1675625-1-ardb+git@google.com> Message-ID: <20240725104332.1675625-2-ardb+git@google.com> Subject: [edk2-devel] [PATCH edk2-platforms 1/5] 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:07:57 -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=Vl59oZxn; 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 --- 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 4071a3fca468..6bd026a7b763 100644 --- a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c +++ b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c @@ -159,10 +159,8 @@ DoDump ( STATIC VOID -EFIAPI DumpVars ( - IN EFI_EVENT Event, - IN VOID *Context + VOID ) { EFI_STATUS Status; @@ -200,6 +198,16 @@ DumpVars ( mFvInstance->Dirty = FALSE; } +STATIC +VOID +EFIAPI +DumpVarsOnEvent ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + DumpVars (); +} VOID ReadyToBootHandler ( @@ -214,7 +222,7 @@ ReadyToBootHandler ( Status = gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, TPL_CALLBACK, - DumpVars, + DumpVarsOnEvent, NULL, &ImageInstallEvent ); @@ -227,7 +235,7 @@ ReadyToBootHandler ( ); ASSERT_EFI_ERROR (Status); - DumpVars (NULL, NULL); + DumpVars (); Status = gBS->CloseEvent (Event); ASSERT_EFI_ERROR (Status); } @@ -245,7 +253,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 (#120095): https://edk2.groups.io/g/devel/message/120095 Mute This Topic: https://groups.io/mt/107628959/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-