From 58618c26a10632a98ee7f8be957ba5288a39af69 Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Tue, 2 Nov 2021 13:45:16 -0600 Subject: [PATCH] lib/thread: Use __func__ instead of repeating function name This cleans up the warning message: WARNING: Prefer using '"%s...", __func__' to using 'thread_run', this function's name, in a string BUG=b:179699789 TEST=boot guybrush Signed-off-by: Raul E Rangel Change-Id: I85bacb7b2d9ebec40b6b05edc2ecf0ca1fc8ceee Reviewed-on: https://review.coreboot.org/c/coreboot/+/58867 Tested-by: build bot (Jenkins) Reviewed-by: Rob Barnes --- src/lib/thread.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/thread.c b/src/lib/thread.c index a07539415f..7d5cdc5b8e 100644 --- a/src/lib/thread.c +++ b/src/lib/thread.c @@ -284,14 +284,14 @@ int thread_run(struct thread_handle *handle, enum cb_err (*func)(void *), void * if (!thread_can_yield(current)) { printk(BIOS_ERR, - "ERROR: thread_run() called from non-yielding context!\n"); + "ERROR: %s() called from non-yielding context!\n", __func__); return -1; } t = get_free_thread(); if (t == NULL) { - printk(BIOS_ERR, "ERROR: thread_run() No more threads!\n"); + printk(BIOS_ERR, "ERROR: %s: No more threads!\n", __func__); return -1; } @@ -319,14 +319,14 @@ int thread_run_until(struct thread_handle *handle, enum cb_err (*func)(void *), if (!thread_can_yield(current)) { printk(BIOS_ERR, - "ERROR: thread_run() called from non-yielding context!\n"); + "ERROR: %s() called from non-yielding context!\n", __func__); return -1; } t = get_free_thread(); if (t == NULL) { - printk(BIOS_ERR, "ERROR: thread_run() No more threads!\n"); + printk(BIOS_ERR, "ERROR: %s: No more threads!\n", __func__); return -1; }