Print this page
12257 resync smatch to 0.6.1-rc1-il-4


  14 
  15 void func (void)
  16 {
  17         int lock = 1;
  18         int flags = 1;
  19 
  20         if (!spin_trylock_irqsave(lock, flags))
  21                 return;
  22         _spin_unlock_irqrestore(lock, flags);
  23         if (zzz)
  24                 return;
  25         if (spin_trylock_irqsave(lock, flags))
  26                 return;
  27         return;
  28 }
  29 /*
  30  * check-name: Smatch locking #6
  31  * check-command: smatch -p=kernel sm_locking6.c
  32  *
  33  * check-output-start
  34 sm_locking6.c:27 func() warn: inconsistent returns 'irqsave:flags'.
  35   Locked on:   line 26
  36   Unlocked on: line 21
  37                line 24
  38                line 27
  39 sm_locking6.c:27 func() warn: inconsistent returns 'spin_lock:lock'.
  40   Locked on:   line 26
  41   Unlocked on: line 21
  42                line 24
  43                line 27
  44  * check-output-end
  45  */


  14 
  15 void func (void)
  16 {
  17         int lock = 1;
  18         int flags = 1;
  19 
  20         if (!spin_trylock_irqsave(lock, flags))
  21                 return;
  22         _spin_unlock_irqrestore(lock, flags);
  23         if (zzz)
  24                 return;
  25         if (spin_trylock_irqsave(lock, flags))
  26                 return;
  27         return;
  28 }
  29 /*
  30  * check-name: Smatch locking #6
  31  * check-command: smatch -p=kernel sm_locking6.c
  32  *
  33  * check-output-start
  34 sm_locking6.c:27 func() warn: inconsistent returns 'flags'.
  35   Locked on  : 26
  36   Unlocked on: 21,24,27
  37 sm_locking6.c:27 func() warn: inconsistent returns 'lock'.
  38   Locked on  : 26
  39   Unlocked on: 21,24,27




  40  * check-output-end
  41  */