From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.25912.1685606246221227706 for ; Thu, 01 Jun 2023 00:57:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UkBI7Nze; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) 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 dfw.source.kernel.org (Postfix) with ESMTPS id B75B7610AA for ; Thu, 1 Jun 2023 07:57:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28056C4339B for ; Thu, 1 Jun 2023 07:57:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685606245; bh=6BWwedzTwV2HwTmtLi1M5lfXeVukBZMbmvl7bCtKdt0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=UkBI7Nze45wBXPqUG/q4Upe0EnI/2rz94Sr//+OlduBAymdfeuO6vKzZJu94JGCj2 YQXEO28jhIRaZmuTA1y6l0BQb8CIXqAWdAe1d4jv0uuUkMOIGv6WBP27f2lWZ2Cii1 GduRt0Y5Kf2nGzUrdUY5TWSYJ0OFf7mlZiHim34NIWxhbr+yCpYQG2Vx75RmDaJjqW KvXwquHMDbqhcYiJd8fFmnmuicHHRAnop7PoWAXxslaejLLgwc2Z73MoPmkNF6JzMK zReM2QUaxtgKajmM/1ewpAcwDc2wZflIilBptfj6K/8IgP5nB7dMF7XsvsqDBvS39E l0I3Ye3uwR2kQ== Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-4f4f89f71b8so522776e87.3 for ; Thu, 01 Jun 2023 00:57:25 -0700 (PDT) X-Gm-Message-State: AC+VfDzREEX2eAymlG8yCKCsMbyUVKCH4IhWT00jZwJK/QF5hc8B6EqB igzvceiH+YkECGgI2gyXwP6nFQ5X2wtKv+4Gc0c= X-Google-Smtp-Source: ACHHUZ7E/iLaiD9ajfqd6DWnJ/S3+HDKclz83aR3odz8tPxWUVsMi06wJqHK8VOzjaGF9cQX//3tvizuyH6gMpFa8ew= X-Received: by 2002:a2e:8410:0:b0:2a8:bd1f:a377 with SMTP id z16-20020a2e8410000000b002a8bd1fa377mr4301623ljg.20.1685606243231; Thu, 01 Jun 2023 00:57:23 -0700 (PDT) MIME-Version: 1.0 References: <20230512142306.1323983-1-kraxel@redhat.com> <20230512142306.1323983-3-kraxel@redhat.com> In-Reply-To: <20230512142306.1323983-3-kraxel@redhat.com> From: "Ard Biesheuvel" Date: Thu, 1 Jun 2023 09:57:11 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/5] ArmVirt/PlatformBootManagerLib: factor out IsVirtio() To: Gerd Hoffmann Cc: devel@edk2.groups.io, Jiewen Yao , Jordan Justen , Leif Lindholm , Pawel Polawski , Sami Mujawar , Oliver Steffen , Ard Biesheuvel Content-Type: text/plain; charset="UTF-8" On Fri, 12 May 2023 at 16:23, Gerd Hoffmann wrote: > > IsVirtioRng() becomes just a thin wrapper for IsVirtio(). > This allows to add similar thin wrappers for other virtio > devices in the future. > > Signed-off-by: Gerd Hoffmann Reviewed-by: Ard Biesheuvel > --- > .../PlatformBootManagerLib/PlatformBm.c | 26 +++++++++++++++---- > 1 file changed, 21 insertions(+), 5 deletions(-) > > diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c > index 10c815378cd5..5eb6f0f9c14a 100644 > --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c > +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c > @@ -269,15 +269,16 @@ IsPciDisplay ( > } > > /** > - This FILTER_FUNCTION checks if a handle corresponds to a Virtio RNG device at > - the VIRTIO_DEVICE_PROTOCOL level. > + This function checks if a handle corresponds to the Virtio Device ID given > + at the VIRTIO_DEVICE_PROTOCOL level. > **/ > STATIC > BOOLEAN > EFIAPI > -IsVirtioRng ( > +IsVirtio ( > IN EFI_HANDLE Handle, > - IN CONST CHAR16 *ReportText > + IN CONST CHAR16 *ReportText, > + IN UINT16 VirtIoDeviceId > ) > { > EFI_STATUS Status; > @@ -293,7 +294,22 @@ IsVirtioRng ( > } > > return (BOOLEAN)(VirtIo->SubSystemDeviceId == > - VIRTIO_SUBSYSTEM_ENTROPY_SOURCE); > + VirtIoDeviceId); > +} > + > +/** > + This FILTER_FUNCTION checks if a handle corresponds to a Virtio RNG device at > + the VIRTIO_DEVICE_PROTOCOL level. > +**/ > +STATIC > +BOOLEAN > +EFIAPI > +IsVirtioRng ( > + IN EFI_HANDLE Handle, > + IN CONST CHAR16 *ReportText > + ) > +{ > + return IsVirtio (Handle, ReportText, VIRTIO_SUBSYSTEM_ENTROPY_SOURCE); > } > > /** > -- > 2.40.1 >