From c60f599bcb9bf9256eb87c1c60add55d23f76de3 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sun, 17 Apr 2022 11:29:47 -0700 Subject: util/log: Rename qemu_log_lock to qemu_log_trylock This function can fail, which makes it more like ftrylockfile or pthread_mutex_trylock than flockfile or pthread_mutex_lock, so rename it. To closer match the other trylock functions, release rcu_read_lock along the failure path, so that qemu_log_unlock need not be called on failure. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson Message-Id: <20220417183019.755276-8-richard.henderson@linaro.org> --- net/can/can_socketcan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/can') diff --git a/net/can/can_socketcan.c b/net/can/can_socketcan.c index 4b68f60c6b..4a505643e9 100644 --- a/net/can/can_socketcan.c +++ b/net/can/can_socketcan.c @@ -76,7 +76,7 @@ QEMU_BUILD_BUG_ON(offsetof(qemu_can_frame, data) static void can_host_socketcan_display_msg(struct qemu_can_frame *msg) { int i; - FILE *logfile = qemu_log_lock(); + FILE *logfile = qemu_log_trylock(); qemu_log("[cansocketcan]: %03X [%01d] %s %s", msg->can_id & QEMU_CAN_EFF_MASK, msg->can_dlc, -- cgit v1.2.3-55-g7522