irq_lock.cocci 566 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /// Use unsigned int as the return value for irq_lock()
  2. ///
  3. // Confidence: High
  4. // Copyright (c) 2017 Intel Corporation
  5. //
  6. // SPDX-License-Identifier: Apache-2.0
  7. virtual patch
  8. @find depends on !(file in "ext")@
  9. type T;
  10. identifier i;
  11. typedef uint32_t,uint32_t;
  12. @@
  13. (
  14. uint32_t i = irq_lock();
  15. |
  16. unsigned int i = irq_lock();
  17. |
  18. uint32_t i = irq_lock();
  19. |
  20. - T
  21. + unsigned int
  22. i = irq_lock();
  23. )
  24. @find2 depends on !(file in "ext") exists@
  25. type T;
  26. identifier i;
  27. @@
  28. (
  29. uint32_t i;
  30. |
  31. unsigned int i;
  32. |
  33. uint32_t i;
  34. |
  35. - T
  36. + unsigned int
  37. i;
  38. ...
  39. i = irq_lock();
  40. )