]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: get rid of lgtm annotations
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 10 Oct 2022 07:31:58 +0000 (09:31 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 11 Oct 2022 14:59:00 +0000 (16:59 +0200)
We now use CodeQL, and LGTM itself is gone. Those old annotations are not
useful for anythign now.

src/analyze/analyze-critical-chain.c
src/basic/errno-util.h
src/basic/in-addr-util.c
src/libsystemd/sd-journal/journal-verify.c

index bb077e2293fedff0542db4a5153018d542275f07..f782f95d5f229b9359537d6bff1c4542db514c71 100644 (file)
@@ -98,7 +98,7 @@ static int list_dependencies_one(sd_bus *bus, const char *name, unsigned level,
                 return r;
 
         STRV_FOREACH(c, deps) {
-                times = hashmap_get(unit_times_hashmap, *c); /* lgtm [cpp/inconsistent-null-check] */
+                times = hashmap_get(unit_times_hashmap, *c);
                 if (times_in_range(times, boot) && times->activated >= service_longest)
                         service_longest = times->activated;
         }
@@ -107,7 +107,7 @@ static int list_dependencies_one(sd_bus *bus, const char *name, unsigned level,
                 return r;
 
         STRV_FOREACH(c, deps) {
-                times = hashmap_get(unit_times_hashmap, *c); /* lgtm [cpp/inconsistent-null-check] */
+                times = hashmap_get(unit_times_hashmap, *c);
                 if (times_in_range(times, boot) && service_longest - times->activated <= arg_fuzz)
                         to_print++;
         }
@@ -116,7 +116,7 @@ static int list_dependencies_one(sd_bus *bus, const char *name, unsigned level,
                 return r;
 
         STRV_FOREACH(c, deps) {
-                times = hashmap_get(unit_times_hashmap, *c); /* lgtm [cpp/inconsistent-null-check] */
+                times = hashmap_get(unit_times_hashmap, *c);
                 if (!times_in_range(times, boot) || service_longest - times->activated > arg_fuzz)
                         continue;
 
index 1e2e5b9f15b5f8c0a202a293e75c6a13b8195267..66b3e53ade2759cbeee13d3b02f9380db9093e47 100644 (file)
@@ -75,7 +75,7 @@ static inline int RET_NERRNO(int ret) {
 
 static inline const char *strerror_safe(int error) {
         /* 'safe' here does NOT mean thread safety. */
-        return strerror(abs(error)); /* lgtm [cpp/potentially-dangerous-function] */
+        return strerror(abs(error));
 }
 
 static inline int errno_or_else(int fallback) {
index cefe3f7661bd6407e51b73f919b5df14accfaff5..7b05a40b08d179b62720e1e29279f20db0c9adc1 100644 (file)
@@ -66,7 +66,7 @@ bool in4_addr_is_link_local_dynamic(const struct in_addr *a) {
 bool in6_addr_is_link_local(const struct in6_addr *a) {
         assert(a);
 
-        return IN6_IS_ADDR_LINKLOCAL(a); /* lgtm [cpp/potentially-dangerous-function] */
+        return IN6_IS_ADDR_LINKLOCAL(a);
 }
 
 int in_addr_is_link_local(int family, const union in_addr_union *u) {
@@ -131,7 +131,7 @@ int in_addr_is_localhost(int family, const union in_addr_union *u) {
                 return in4_addr_is_localhost(&u->in);
 
         if (family == AF_INET6)
-                return IN6_IS_ADDR_LOOPBACK(&u->in6); /* lgtm [cpp/potentially-dangerous-function] */
+                return IN6_IS_ADDR_LOOPBACK(&u->in6);
 
         return -EAFNOSUPPORT;
 }
@@ -144,7 +144,7 @@ int in_addr_is_localhost_one(int family, const union in_addr_union *u) {
                 return be32toh(u->in.s_addr) == UINT32_C(0x7F000001);
 
         if (family == AF_INET6)
-                return IN6_IS_ADDR_LOOPBACK(&u->in6); /* lgtm [cpp/potentially-dangerous-function] */
+                return IN6_IS_ADDR_LOOPBACK(&u->in6);
 
         return -EAFNOSUPPORT;
 }
index b9f6a161edca6dbb80297f17864a7d7fb1ed44de..387963d6f3c5c6ed58cc3263b872fc47e88bf104 100644 (file)
@@ -67,7 +67,7 @@ static uint64_t scale_progress(uint64_t scale, uint64_t p, uint64_t m) {
          * Currently all callers use m >= 1, but we keep the check to be defensive.
          */
 
-        if (p >= m || m == 0) // lgtm[cpp/constant-comparison]
+        if (p >= m || m == 0)
                 return scale;
 
         return scale * p / m;