Details
-
Improvement
-
Resolution: Fixed
-
Trivial
-
None
-
None
-
Master
-
9223372036854775807
Description
checkpatch trows a warning if it finds an "UPPERCASE" on the left and side. According to the script/code it is to avoid cases like "foo + BAR < baz".
However for our case "#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(3, 0, 53, 0)" this warning is false positive.
This could be recreated as:
/* Fake values. For demo purpose */ #define SUM(a, b) (a + b) #define LUSTRE_VERSION_CODE 50 #define lustre_version_code 50 /* This case passes */ #if lustre_verison_code < SUM(10, 4) int x; #endif /* This case passes */ #if SUM(10, 4) < lustre_verison_code int x1; #endif /* This case passes */ #if SUM(10, 4) < LUSTRE_VERSION_CODE int x2; #endif /* This case FAILS. Proposed patch to fix this case */ #if LUSTRE_VERSION_CODE < SUM(10, 4) int x3; #endif