* [PATCH 1/1] efi_selftest: prefix test functions with efi_st_
@ 2022-09-22 13:26 Heinrich Schuchardt
2022-09-22 13:30 ` Ilias Apalodimas
2022-09-24 18:00 ` Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2022-09-22 13:26 UTC (permalink / raw)
To: Ilias Apalodimas
Cc: u-boot, Pali Rohár, Tom Rini, Simon Glass, Heinrich Schuchardt
An upcoming patch set creates a global function flush(). To make debugging
easier we should not use the same name for a static function.
Rename static functions in the LoadImage() unit test adding an efi_st_
prefix.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
lib/efi_selftest/efi_selftest_loadimage.c | 87 ++++++++++++-----------
1 file changed, 44 insertions(+), 43 deletions(-)
diff --git a/lib/efi_selftest/efi_selftest_loadimage.c b/lib/efi_selftest/efi_selftest_loadimage.c
index d4c76f557c..24548f1ae6 100644
--- a/lib/efi_selftest/efi_selftest_loadimage.c
+++ b/lib/efi_selftest/efi_selftest_loadimage.c
@@ -142,38 +142,39 @@ static struct efi_file_system_info *file_system_info =
&priv_file_system_info.info;
/* Forward definitions of file and file system functions */
-static efi_status_t EFIAPI open_volume
+static efi_status_t EFIAPI efi_st_open_volume
(struct efi_simple_file_system_protocol *this,
struct efi_file_handle **root);
-static efi_status_t EFIAPI open
+static efi_status_t EFIAPI efi_st_open
(struct efi_file_handle *this,
struct efi_file_handle **new_handle,
u16 *file_name, u64 open_mode, u64 attributes);
-static efi_status_t EFIAPI close(struct efi_file_handle *this);
+static efi_status_t EFIAPI efi_st_close(struct efi_file_handle *this);
-static efi_status_t EFIAPI delete(struct efi_file_handle *this);
+static efi_status_t EFIAPI efi_st_delete(struct efi_file_handle *this);
-static efi_status_t EFIAPI read
+static efi_status_t EFIAPI efi_st_read
(struct efi_file_handle *this, efi_uintn_t *buffer_size, void *buffer);
-static efi_status_t EFIAPI write
+static efi_status_t EFIAPI efi_st_write
(struct efi_file_handle *this, efi_uintn_t *buffer_size, void *buffer);
-static efi_status_t EFIAPI getpos(struct efi_file_handle *this, u64 *pos);
+static efi_status_t EFIAPI efi_st_getpos(struct efi_file_handle *this,
+ u64 *pos);
-static efi_status_t EFIAPI setpos(struct efi_file_handle *this, u64 pos);
+static efi_status_t EFIAPI efi_st_setpos(struct efi_file_handle *this, u64 pos);
-static efi_status_t EFIAPI getinfo
+static efi_status_t EFIAPI efi_st_getinfo
(struct efi_file_handle *this, const efi_guid_t *info_type,
efi_uintn_t *buffer_size, void *buffer);
-static efi_status_t EFIAPI setinfo
+static efi_status_t EFIAPI efi_st_setinfo
(struct efi_file_handle *this, const efi_guid_t *info_type,
efi_uintn_t buffer_size, void *buffer);
-static efi_status_t EFIAPI flush(struct efi_file_handle *this);
+static efi_status_t EFIAPI efi_st_flush(struct efi_file_handle *this);
/* Internal information about status of file system */
static struct {
@@ -190,40 +191,40 @@ static struct {
/* EFI_FILE_PROTOCOL for file */
static struct efi_file_handle file = {
.rev = 0x00010000,
- .open = open,
- .close = close,
- .delete = delete,
- .read = read,
- .write = write,
- .getpos = getpos,
- .setpos = setpos,
- .getinfo = getinfo,
- .setinfo = setinfo,
- .flush = flush,
+ .open = efi_st_open,
+ .close = efi_st_close,
+ .delete = efi_st_delete,
+ .read = efi_st_read,
+ .write = efi_st_write,
+ .getpos = efi_st_getpos,
+ .setpos = efi_st_setpos,
+ .getinfo = efi_st_getinfo,
+ .setinfo = efi_st_setinfo,
+ .flush = efi_st_flush,
};
/* EFI_FILE_PROTOCOL for root directory */
static struct efi_file_handle volume = {
.rev = 0x00010000,
- .open = open,
- .close = close,
- .delete = delete,
- .read = read,
- .write = write,
- .getpos = getpos,
- .setpos = setpos,
- .getinfo = getinfo,
- .setinfo = setinfo,
- .flush = flush,
+ .open = efi_st_open,
+ .close = efi_st_close,
+ .delete = efi_st_delete,
+ .read = efi_st_read,
+ .write = efi_st_write,
+ .getpos = efi_st_getpos,
+ .setpos = efi_st_setpos,
+ .getinfo = efi_st_getinfo,
+ .setinfo = efi_st_setinfo,
+ .flush = efi_st_flush,
};
/* EFI_SIMPLE_FILE_SYSTEM_PROTOCOL of the block device */
struct efi_simple_file_system_protocol file_system = {
.rev = 0x00010000,
- .open_volume = open_volume,
+ .open_volume = efi_st_open_volume,
};
-static efi_status_t EFIAPI open_volume
+static efi_status_t EFIAPI efi_st_open_volume
(struct efi_simple_file_system_protocol *this,
struct efi_file_handle **root)
{
@@ -236,7 +237,7 @@ static efi_status_t EFIAPI open_volume
return EFI_SUCCESS;
}
-static efi_status_t EFIAPI open
+static efi_status_t EFIAPI efi_st_open
(struct efi_file_handle *this,
struct efi_file_handle **new_handle,
u16 *file_name, u64 open_mode, u64 attributes)
@@ -251,7 +252,7 @@ static efi_status_t EFIAPI open
return EFI_SUCCESS;
}
-static efi_status_t EFIAPI close(struct efi_file_handle *this)
+static efi_status_t EFIAPI efi_st_close(struct efi_file_handle *this)
{
if (this == &file)
priv.file_open_count--;
@@ -263,7 +264,7 @@ static efi_status_t EFIAPI close(struct efi_file_handle *this)
return EFI_SUCCESS;
}
-static efi_status_t EFIAPI delete(struct efi_file_handle *this)
+static efi_status_t EFIAPI efi_st_delete(struct efi_file_handle *this)
{
if (this != &file)
return EFI_INVALID_PARAMETER;
@@ -271,7 +272,7 @@ static efi_status_t EFIAPI delete(struct efi_file_handle *this)
return EFI_UNSUPPORTED;
}
-static efi_status_t EFIAPI read
+static efi_status_t EFIAPI efi_st_read
(struct efi_file_handle *this, efi_uintn_t *buffer_size, void *buffer)
{
if (this != &file)
@@ -288,7 +289,7 @@ static efi_status_t EFIAPI read
return EFI_SUCCESS;
}
-static efi_status_t EFIAPI write
+static efi_status_t EFIAPI efi_st_write
(struct efi_file_handle *this, efi_uintn_t *buffer_size, void *buffer)
{
if (this != &file)
@@ -297,7 +298,7 @@ static efi_status_t EFIAPI write
return EFI_UNSUPPORTED;
}
-static efi_status_t EFIAPI getpos(struct efi_file_handle *this, u64 *pos)
+static efi_status_t EFIAPI efi_st_getpos(struct efi_file_handle *this, u64 *pos)
{
if (this != &file)
return EFI_INVALID_PARAMETER;
@@ -307,7 +308,7 @@ static efi_status_t EFIAPI getpos(struct efi_file_handle *this, u64 *pos)
return EFI_SUCCESS;
}
-static efi_status_t EFIAPI setpos(struct efi_file_handle *this, u64 pos)
+static efi_status_t EFIAPI efi_st_setpos(struct efi_file_handle *this, u64 pos)
{
if (this != &file)
return EFI_INVALID_PARAMETER;
@@ -317,7 +318,7 @@ static efi_status_t EFIAPI setpos(struct efi_file_handle *this, u64 pos)
return EFI_SUCCESS;
}
-static efi_status_t EFIAPI getinfo
+static efi_status_t EFIAPI efi_st_getinfo
(struct efi_file_handle *this, const efi_guid_t *info_type,
efi_uintn_t *buffer_size, void *buffer)
{
@@ -348,7 +349,7 @@ static efi_status_t EFIAPI getinfo
return EFI_SUCCESS;
}
-static efi_status_t EFIAPI setinfo
+static efi_status_t EFIAPI efi_st_setinfo
(struct efi_file_handle *this, const efi_guid_t *info_type,
efi_uintn_t buffer_size, void *buffer)
{
@@ -358,7 +359,7 @@ static efi_status_t EFIAPI setinfo
return EFI_UNSUPPORTED;
}
-static efi_status_t EFIAPI flush(struct efi_file_handle *this)
+static efi_status_t EFIAPI efi_st_flush(struct efi_file_handle *this)
{
if (this != &file)
return EFI_INVALID_PARAMETER;
--
2.37.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] efi_selftest: prefix test functions with efi_st_
2022-09-22 13:26 [PATCH 1/1] efi_selftest: prefix test functions with efi_st_ Heinrich Schuchardt
@ 2022-09-22 13:30 ` Ilias Apalodimas
2022-09-24 18:00 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Ilias Apalodimas @ 2022-09-22 13:30 UTC (permalink / raw)
To: Heinrich Schuchardt; +Cc: u-boot, Pali Rohár, Tom Rini, Simon Glass
On Thu, Sep 22, 2022 at 03:26:43PM +0200, Heinrich Schuchardt wrote:
> An upcoming patch set creates a global function flush(). To make debugging
> easier we should not use the same name for a static function.
>
> Rename static functions in the LoadImage() unit test adding an efi_st_
> prefix.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
> lib/efi_selftest/efi_selftest_loadimage.c | 87 ++++++++++++-----------
> 1 file changed, 44 insertions(+), 43 deletions(-)
>
> diff --git a/lib/efi_selftest/efi_selftest_loadimage.c b/lib/efi_selftest/efi_selftest_loadimage.c
> index d4c76f557c..24548f1ae6 100644
> --- a/lib/efi_selftest/efi_selftest_loadimage.c
> +++ b/lib/efi_selftest/efi_selftest_loadimage.c
> @@ -142,38 +142,39 @@ static struct efi_file_system_info *file_system_info =
> &priv_file_system_info.info;
>
> /* Forward definitions of file and file system functions */
> -static efi_status_t EFIAPI open_volume
> +static efi_status_t EFIAPI efi_st_open_volume
> (struct efi_simple_file_system_protocol *this,
> struct efi_file_handle **root);
>
> -static efi_status_t EFIAPI open
> +static efi_status_t EFIAPI efi_st_open
> (struct efi_file_handle *this,
> struct efi_file_handle **new_handle,
> u16 *file_name, u64 open_mode, u64 attributes);
>
> -static efi_status_t EFIAPI close(struct efi_file_handle *this);
> +static efi_status_t EFIAPI efi_st_close(struct efi_file_handle *this);
>
> -static efi_status_t EFIAPI delete(struct efi_file_handle *this);
> +static efi_status_t EFIAPI efi_st_delete(struct efi_file_handle *this);
>
> -static efi_status_t EFIAPI read
> +static efi_status_t EFIAPI efi_st_read
> (struct efi_file_handle *this, efi_uintn_t *buffer_size, void *buffer);
>
> -static efi_status_t EFIAPI write
> +static efi_status_t EFIAPI efi_st_write
> (struct efi_file_handle *this, efi_uintn_t *buffer_size, void *buffer);
>
> -static efi_status_t EFIAPI getpos(struct efi_file_handle *this, u64 *pos);
> +static efi_status_t EFIAPI efi_st_getpos(struct efi_file_handle *this,
> + u64 *pos);
>
> -static efi_status_t EFIAPI setpos(struct efi_file_handle *this, u64 pos);
> +static efi_status_t EFIAPI efi_st_setpos(struct efi_file_handle *this, u64 pos);
>
> -static efi_status_t EFIAPI getinfo
> +static efi_status_t EFIAPI efi_st_getinfo
> (struct efi_file_handle *this, const efi_guid_t *info_type,
> efi_uintn_t *buffer_size, void *buffer);
>
> -static efi_status_t EFIAPI setinfo
> +static efi_status_t EFIAPI efi_st_setinfo
> (struct efi_file_handle *this, const efi_guid_t *info_type,
> efi_uintn_t buffer_size, void *buffer);
>
> -static efi_status_t EFIAPI flush(struct efi_file_handle *this);
> +static efi_status_t EFIAPI efi_st_flush(struct efi_file_handle *this);
>
> /* Internal information about status of file system */
> static struct {
> @@ -190,40 +191,40 @@ static struct {
> /* EFI_FILE_PROTOCOL for file */
> static struct efi_file_handle file = {
> .rev = 0x00010000,
> - .open = open,
> - .close = close,
> - .delete = delete,
> - .read = read,
> - .write = write,
> - .getpos = getpos,
> - .setpos = setpos,
> - .getinfo = getinfo,
> - .setinfo = setinfo,
> - .flush = flush,
> + .open = efi_st_open,
> + .close = efi_st_close,
> + .delete = efi_st_delete,
> + .read = efi_st_read,
> + .write = efi_st_write,
> + .getpos = efi_st_getpos,
> + .setpos = efi_st_setpos,
> + .getinfo = efi_st_getinfo,
> + .setinfo = efi_st_setinfo,
> + .flush = efi_st_flush,
> };
>
> /* EFI_FILE_PROTOCOL for root directory */
> static struct efi_file_handle volume = {
> .rev = 0x00010000,
> - .open = open,
> - .close = close,
> - .delete = delete,
> - .read = read,
> - .write = write,
> - .getpos = getpos,
> - .setpos = setpos,
> - .getinfo = getinfo,
> - .setinfo = setinfo,
> - .flush = flush,
> + .open = efi_st_open,
> + .close = efi_st_close,
> + .delete = efi_st_delete,
> + .read = efi_st_read,
> + .write = efi_st_write,
> + .getpos = efi_st_getpos,
> + .setpos = efi_st_setpos,
> + .getinfo = efi_st_getinfo,
> + .setinfo = efi_st_setinfo,
> + .flush = efi_st_flush,
> };
>
> /* EFI_SIMPLE_FILE_SYSTEM_PROTOCOL of the block device */
> struct efi_simple_file_system_protocol file_system = {
> .rev = 0x00010000,
> - .open_volume = open_volume,
> + .open_volume = efi_st_open_volume,
> };
>
> -static efi_status_t EFIAPI open_volume
> +static efi_status_t EFIAPI efi_st_open_volume
> (struct efi_simple_file_system_protocol *this,
> struct efi_file_handle **root)
> {
> @@ -236,7 +237,7 @@ static efi_status_t EFIAPI open_volume
> return EFI_SUCCESS;
> }
>
> -static efi_status_t EFIAPI open
> +static efi_status_t EFIAPI efi_st_open
> (struct efi_file_handle *this,
> struct efi_file_handle **new_handle,
> u16 *file_name, u64 open_mode, u64 attributes)
> @@ -251,7 +252,7 @@ static efi_status_t EFIAPI open
> return EFI_SUCCESS;
> }
>
> -static efi_status_t EFIAPI close(struct efi_file_handle *this)
> +static efi_status_t EFIAPI efi_st_close(struct efi_file_handle *this)
> {
> if (this == &file)
> priv.file_open_count--;
> @@ -263,7 +264,7 @@ static efi_status_t EFIAPI close(struct efi_file_handle *this)
> return EFI_SUCCESS;
> }
>
> -static efi_status_t EFIAPI delete(struct efi_file_handle *this)
> +static efi_status_t EFIAPI efi_st_delete(struct efi_file_handle *this)
> {
> if (this != &file)
> return EFI_INVALID_PARAMETER;
> @@ -271,7 +272,7 @@ static efi_status_t EFIAPI delete(struct efi_file_handle *this)
> return EFI_UNSUPPORTED;
> }
>
> -static efi_status_t EFIAPI read
> +static efi_status_t EFIAPI efi_st_read
> (struct efi_file_handle *this, efi_uintn_t *buffer_size, void *buffer)
> {
> if (this != &file)
> @@ -288,7 +289,7 @@ static efi_status_t EFIAPI read
> return EFI_SUCCESS;
> }
>
> -static efi_status_t EFIAPI write
> +static efi_status_t EFIAPI efi_st_write
> (struct efi_file_handle *this, efi_uintn_t *buffer_size, void *buffer)
> {
> if (this != &file)
> @@ -297,7 +298,7 @@ static efi_status_t EFIAPI write
> return EFI_UNSUPPORTED;
> }
>
> -static efi_status_t EFIAPI getpos(struct efi_file_handle *this, u64 *pos)
> +static efi_status_t EFIAPI efi_st_getpos(struct efi_file_handle *this, u64 *pos)
> {
> if (this != &file)
> return EFI_INVALID_PARAMETER;
> @@ -307,7 +308,7 @@ static efi_status_t EFIAPI getpos(struct efi_file_handle *this, u64 *pos)
> return EFI_SUCCESS;
> }
>
> -static efi_status_t EFIAPI setpos(struct efi_file_handle *this, u64 pos)
> +static efi_status_t EFIAPI efi_st_setpos(struct efi_file_handle *this, u64 pos)
> {
> if (this != &file)
> return EFI_INVALID_PARAMETER;
> @@ -317,7 +318,7 @@ static efi_status_t EFIAPI setpos(struct efi_file_handle *this, u64 pos)
> return EFI_SUCCESS;
> }
>
> -static efi_status_t EFIAPI getinfo
> +static efi_status_t EFIAPI efi_st_getinfo
> (struct efi_file_handle *this, const efi_guid_t *info_type,
> efi_uintn_t *buffer_size, void *buffer)
> {
> @@ -348,7 +349,7 @@ static efi_status_t EFIAPI getinfo
> return EFI_SUCCESS;
> }
>
> -static efi_status_t EFIAPI setinfo
> +static efi_status_t EFIAPI efi_st_setinfo
> (struct efi_file_handle *this, const efi_guid_t *info_type,
> efi_uintn_t buffer_size, void *buffer)
> {
> @@ -358,7 +359,7 @@ static efi_status_t EFIAPI setinfo
> return EFI_UNSUPPORTED;
> }
>
> -static efi_status_t EFIAPI flush(struct efi_file_handle *this)
> +static efi_status_t EFIAPI efi_st_flush(struct efi_file_handle *this)
> {
> if (this != &file)
> return EFI_INVALID_PARAMETER;
> --
> 2.37.2
>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] efi_selftest: prefix test functions with efi_st_
2022-09-22 13:26 [PATCH 1/1] efi_selftest: prefix test functions with efi_st_ Heinrich Schuchardt
2022-09-22 13:30 ` Ilias Apalodimas
@ 2022-09-24 18:00 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2022-09-24 18:00 UTC (permalink / raw)
To: Heinrich Schuchardt
Cc: Ilias Apalodimas, u-boot, Pali Rohár, Simon Glass
[-- Attachment #1: Type: text/plain, Size: 492 bytes --]
On Thu, Sep 22, 2022 at 03:26:43PM +0200, Heinrich Schuchardt wrote:
> An upcoming patch set creates a global function flush(). To make debugging
> easier we should not use the same name for a static function.
>
> Rename static functions in the LoadImage() unit test adding an efi_st_
> prefix.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Applied to u-boot/next, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-24 18:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 13:26 [PATCH 1/1] efi_selftest: prefix test functions with efi_st_ Heinrich Schuchardt
2022-09-22 13:30 ` Ilias Apalodimas
2022-09-24 18:00 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).