1 // SPDX-License-Identifier: GPL-2.0-only 1 // SPDX-License-Identifier: GPL-2.0-only 2 /// 2 /// 3 /// Condition !A || A && B is equivalent to !A 3 /// Condition !A || A && B is equivalent to !A || B. 4 /// 4 /// 5 // Confidence: High 5 // Confidence: High 6 // Copyright: (C) 2020 Denis Efremov ISPRAS 6 // Copyright: (C) 2020 Denis Efremov ISPRAS 7 // Options: --no-includes --include-headers 7 // Options: --no-includes --include-headers 8 8 9 virtual patch 9 virtual patch 10 virtual context 10 virtual context 11 virtual org 11 virtual org 12 virtual report 12 virtual report 13 13 14 @r depends on !patch@ 14 @r depends on !patch@ 15 expression A, B; 15 expression A, B; 16 position p; 16 position p; 17 @@ 17 @@ 18 18 19 * !A || (A &&@p B) 19 * !A || (A &&@p B) 20 20 21 @depends on patch@ 21 @depends on patch@ 22 expression A, B; 22 expression A, B; 23 @@ 23 @@ 24 24 25 !A || 25 !A || 26 - (A && B) 26 - (A && B) 27 + B 27 + B 28 28 29 @script:python depends on report@ 29 @script:python depends on report@ 30 p << r.p; 30 p << r.p; 31 @@ 31 @@ 32 32 33 coccilib.report.print_report(p[0], "WARNING !A 33 coccilib.report.print_report(p[0], "WARNING !A || A && B is equivalent to !A || B") 34 34 35 @script:python depends on org@ 35 @script:python depends on org@ 36 p << r.p; 36 p << r.p; 37 @@ 37 @@ 38 38 39 coccilib.org.print_todo(p[0], "WARNING !A || A 39 coccilib.org.print_todo(p[0], "WARNING !A || A && B is equivalent to !A || B")
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.