]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
firewire: core: use WARN_ON_ONCE() to avoid superfluous dumps
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Thu, 5 Sep 2024 13:10:29 +0000 (22:10 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Thu, 5 Sep 2024 13:10:29 +0000 (22:10 +0900)
It is enough to notify programming mistakes to programmers just once.

Suggested-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20240905131029.6433-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
drivers/firewire/core-iso.c

index af76fa1823f1b8e73f052e294d6e89209c4c222f..a249974a0f874a4f285fa750cdf43f117cc185bd 100644 (file)
@@ -220,7 +220,7 @@ int fw_iso_context_flush_completions(struct fw_iso_context *ctx)
        might_sleep();
 
        // Avoid dead lock due to programming mistake.
-       if (WARN_ON(current_work() == &ctx->work))
+       if (WARN_ON_ONCE(current_work() == &ctx->work))
                return 0;
 
        disable_work_sync(&ctx->work);
@@ -244,7 +244,7 @@ int fw_iso_context_stop(struct fw_iso_context *ctx)
        might_sleep();
 
        // Avoid dead lock due to programming mistake.
-       if (WARN_ON(current_work() == &ctx->work))
+       if (WARN_ON_ONCE(current_work() == &ctx->work))
                return 0;
 
        err = ctx->card->driver->stop_iso(ctx);