summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2023-01-22 11:53:56 +0100
committerFelix Singer <felixsinger@posteo.net>2023-02-17 16:08:04 +0000
commit39efcd1ba6cd66f6d2d027714891fd63fe564f5f (patch)
tree061f2499a745faf57ffc73d14c82658cd9a1ad67 /src/lib
parent3a54f4a7f15dc14a0f70ba781b488d63f5b6238e (diff)
tree: Use __func__ instead of hard-coded names
Change-Id: I87e383ce2f28340dbc3c843dbf2ed0e47c00a723 Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/72382 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/gcov-glue.c19
-rw-r--r--src/lib/malloc.c8
2 files changed, 13 insertions, 14 deletions
diff --git a/src/lib/gcov-glue.c b/src/lib/gcov-glue.c
index 6bdb870195..d8ebe70e9e 100644
--- a/src/lib/gcov-glue.c
+++ b/src/lib/gcov-glue.c
@@ -29,8 +29,7 @@ static FILE *previous_file = NULL;
static FILE *fopen(const char *path, const char *mode)
{
#if CONFIG(DEBUG_COVERAGE)
- printk(BIOS_DEBUG, "fopen %s with mode %s\n",
- path, mode);
+ printk(BIOS_DEBUG, "%s %s with mode %s\n", __func__, path, mode);
#endif
if (!current_file) {
current_file = cbmem_add(CBMEM_ID_COVERAGE, 32*1024);
@@ -62,7 +61,7 @@ static FILE *fopen(const char *path, const char *mode)
static int fclose(FILE *stream)
{
#if CONFIG(DEBUG_COVERAGE)
- printk(BIOS_DEBUG, "fclose %s\n", stream->filename);
+ printk(BIOS_DEBUG, "%s %s\n", __func__, stream->filename);
#endif
return 0;
}
@@ -73,8 +72,8 @@ static int fseek(FILE *stream, long offset, int whence)
* to a freshly opened file. */
gcc_assert(offset == 0 && whence == SEEK_SET);
#if CONFIG(DEBUG_COVERAGE)
- printk(BIOS_DEBUG, "fseek %s offset=%ld whence=%d\n",
- stream->filename, offset, whence);
+ printk(BIOS_DEBUG, "%s %s offset=%ld whence=%d\n",
+ __func__, stream->filename, offset, whence);
#endif
return 0;
}
@@ -84,7 +83,7 @@ static long ftell(FILE *stream)
/* ftell should currently not be called */
BUG();
#if CONFIG(DEBUG_COVERAGE)
- printk(BIOS_DEBUG, "ftell %s\n", stream->filename);
+ printk(BIOS_DEBUG, "%s %s\n", __func__, stream->filename);
#endif
return 0;
}
@@ -92,8 +91,8 @@ static long ftell(FILE *stream)
static size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
{
#if CONFIG(DEBUG_COVERAGE)
- printk(BIOS_DEBUG, "fread: ptr=%p size=%zd nmemb=%zd FILE*=%p\n",
- ptr, size, nmemb, stream);
+ printk(BIOS_DEBUG, "%s: ptr=%p size=%zd nmemb=%zd FILE*=%p\n",
+ __func__, ptr, size, nmemb, stream);
#endif
return 0;
}
@@ -101,8 +100,8 @@ static size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
static size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
{
#if CONFIG(DEBUG_COVERAGE)
- printk(BIOS_DEBUG, "fwrite: %zd * %zd bytes to file %s\n",
- nmemb, size, stream->filename);
+ printk(BIOS_DEBUG, "%s: %zd * %zd bytes to file %s\n",
+ __func__, nmemb, size, stream->filename);
#endif
// TODO check if file is last opened file and fail otherwise.
diff --git a/src/lib/malloc.c b/src/lib/malloc.c
index 2c7321915b..052a53e568 100644
--- a/src/lib/malloc.c
+++ b/src/lib/malloc.c
@@ -38,16 +38,16 @@ void *memalign(size_t boundary, size_t size)
free_last_alloc_ptr = p;
if (free_mem_ptr >= free_mem_end_ptr) {
- printk(BIOS_ERR, "memalign(boundary=%zu, size=%zu): failed: ",
- boundary, size);
+ printk(BIOS_ERR, "%s(boundary=%zu, size=%zu): failed: ",
+ __func__, boundary, size);
printk(BIOS_ERR, "Tried to round up free_mem_ptr %p to %p\n",
p, free_mem_ptr);
printk(BIOS_ERR, "but free_mem_end_ptr is %p\n",
free_mem_end_ptr);
- die("Error! memalign: Out of memory (free_mem_ptr >= free_mem_end_ptr)");
+ die("Error! %s: Out of memory (free_mem_ptr >= free_mem_end_ptr)", __func__);
}
- MALLOCDBG("memalign %p\n", p);
+ MALLOCDBG("%s %p\n", __func__, p);
return p;
}