From nobody Tue Feb 10 02:27:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+93958+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+93958+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1663615383; cv=none; d=zohomail.com; s=zohoarc; b=Z8UfoZy5bUz1UiL8u07MSo4Dr/ey5HBpotOjRr401sgIS6UFzh2KK/H1aK4KEhN72eko3bhe0qXjfs8BJnBBU40XilbmtqyoJIpDqvj5puI9h8dpZVAUFNJxhCY7kB5RLMk86bERiNwTox04oOlrvlDfHylx3ipUm6pS6JqxaSo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663615383; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=05pocQJn3jWjmn+raJD1WDQ37Soq/YdMX8oUg/f3/6o=; b=jYYD9PYHoqQSgjEDzARqAIP4nkaolPrcHhG35BDu//MvE+4Vj0zKCu8/zYr3ZELAN8kSlPWv/Zy6MKltr7PwNZ09YgccogfHp+3UfXT7Ihs7bNsWPnyIwJP+Z9M2kqVfhOJG4VwgtSde5OfXyDvDNS5c1un3hZZb2kIZTomn/gU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+93958+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1663615383466944.015450710111; Mon, 19 Sep 2022 12:23:03 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 5DV9YY1788612xVZLByanTje; Mon, 19 Sep 2022 12:23:03 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.3218.1663615382440928545 for ; Mon, 19 Sep 2022 12:23:02 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 962F3143D; Mon, 19 Sep 2022 12:23:08 -0700 (PDT) X-Received: from pierre123.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 95BA53F73B; Mon, 19 Sep 2022 12:22:59 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Rebecca Cran , Michael D Kinney , Liming Gao , Jiewen Yao , Jian J Wang Subject: [edk2-devel] [PATCH v5 15/21] SecurityPkg/RngDxe: Documentation/include/parameter cleanup Date: Mon, 19 Sep 2022 21:22:01 +0200 Message-Id: <20220919192207.637786-16-Pierre.Gondois@arm.com> In-Reply-To: <20220919192207.637786-1-Pierre.Gondois@arm.com> References: <20220919192207.637786-1-Pierre.Gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com X-Gm-Message-State: amZmH3pC7d8rtLKuUJVIK0h2x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1663615383; bh=fu8QSyIbCLu84zEr3j5bMaJnk5zothHAwqU5140Ig5k=; h=Cc:Date:From:Reply-To:Subject:To; b=k8oqP9FTkjkTeEDNeUqBJMGbhbBwlMBrLrsEQpyA9UkETrHdOsaA9SCDkcbV0GLMW3q 2/DrJfU0dO8VBcWB40KIlKnsOj2qM1/QO9YhZ7dQaankoxxFu0ByTcv/oGsdeXUtrQtvj 5hpl5+3b8dSmiu0WtKZvr7cfNrj1DpInpPs= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1663615385004100010 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois This patch: -Update RngGetBytes() documentation to align the function definition and declaration. -Improve input parameter checking. Even though 'This' it is not used, the parameter should always point to the current EFI_RNG_PROTOCOL. -Removes TimerLib inclusion as unused. Signed-off-by: Pierre Gondois --- SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c | 3 +-- SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c | 2 +- SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c b/Se= curityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c index 6d989f7ea376..f9c740d761ff 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c @@ -23,7 +23,6 @@ #include #include #include -#include #include =20 #include "RngDxeInternals.h" @@ -61,7 +60,7 @@ RngGetRNG ( { EFI_STATUS Status; =20 - if ((RNGValueLength =3D=3D 0) || (RNGValue =3D=3D NULL)) { + if ((This =3D=3D NULL) || (RNGValueLength =3D=3D 0) || (RNGValue =3D=3D = NULL)) { return EFI_INVALID_PARAMETER; } =20 diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c b/Secur= ityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c index b2d2236380fd..8f5d8e740f5e 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c @@ -59,7 +59,7 @@ RngGetRNG ( { EFI_STATUS Status; =20 - if ((RNGValueLength =3D=3D 0) || (RNGValue =3D=3D NULL)) { + if ((This =3D=3D NULL) || (RNGValueLength =3D=3D 0) || (RNGValue =3D=3D = NULL)) { return EFI_INVALID_PARAMETER; } =20 diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c b/SecurityPk= g/RandomNumberGenerator/RngDxe/RngDxe.c index 6608ca8804a5..d7905a7f4d72 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c @@ -23,7 +23,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include -#include #include =20 #include "RngDxeInternals.h" @@ -72,7 +71,7 @@ RngDriverEntry ( } =20 /** - Calls RDRAND to fill a buffer of arbitrary size with random bytes. + Runs CPU RNG instruction to fill a buffer of arbitrary size with random = bytes. =20 @param[in] Length Size of the buffer, in bytes, to fill with. @param[out] RandBuffer Pointer to the buffer to store the random res= ult. --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#93958): https://edk2.groups.io/g/devel/message/93958 Mute This Topic: https://groups.io/mt/93788890/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-