LCOV - code coverage report
Current view: top level - sound/core/seq - seq_lock.c (source / functions) Hit Total Coverage
Test: combined.info Lines: 0 9 0.0 %
Date: 2022-04-01 13:59:58 Functions: 0 1 0.0 %
Branches: 0 6 0.0 %

           Branch data     Line data    Source code
       1                 :            : // SPDX-License-Identifier: GPL-2.0-or-later
       2                 :            : /*
       3                 :            :  *  Do sleep inside a spin-lock
       4                 :            :  *  Copyright (c) 1999 by Takashi Iwai <tiwai@suse.de>
       5                 :            :  */
       6                 :            : 
       7                 :            : #include <linux/export.h>
       8                 :            : #include <sound/core.h>
       9                 :            : #include "seq_lock.h"
      10                 :            : 
      11                 :            : /* wait until all locks are released */
      12                 :          0 : void snd_use_lock_sync_helper(snd_use_lock_t *lockp, const char *file, int line)
      13                 :            : {
      14                 :          0 :         int warn_count = 5 * HZ;
      15                 :            : 
      16         [ #  # ]:          0 :         if (atomic_read(lockp) < 0) {
      17                 :          0 :                 pr_warn("ALSA: seq_lock: lock trouble [counter = %d] in %s:%d\n", atomic_read(lockp), file, line);
      18                 :          0 :                 return;
      19                 :            :         }
      20         [ #  # ]:          0 :         while (atomic_read(lockp) > 0) {
      21         [ #  # ]:          0 :                 if (warn_count-- == 0)
      22                 :          0 :                         pr_warn("ALSA: seq_lock: waiting [%d left] in %s:%d\n", atomic_read(lockp), file, line);
      23                 :          0 :                 schedule_timeout_uninterruptible(1);
      24                 :            :         }
      25                 :            : }
      26                 :            : EXPORT_SYMBOL(snd_use_lock_sync_helper);

Generated by: LCOV version 1.14