Merge pull request #17676 from yuwata/lgtm-fixes

tree-wide: several fixes prompted by LGTM
This commit is contained in:
Lennart Poettering 2020-11-23 22:18:28 +01:00 committed by GitHub
commit e3650d619a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 13 deletions

View File

@ -145,13 +145,12 @@ static void print_source(uint64_t flags, usec_t rtt) {
printf("\n%s-- Information acquired via", ansi_grey());
if (flags != 0)
printf(" protocol%s%s%s%s%s",
flags & SD_RESOLVED_DNS ? " DNS" :"",
flags & SD_RESOLVED_LLMNR_IPV4 ? " LLMNR/IPv4" : "",
flags & SD_RESOLVED_LLMNR_IPV6 ? " LLMNR/IPv6" : "",
flags & SD_RESOLVED_MDNS_IPV4 ? " mDNS/IPv4" : "",
flags & SD_RESOLVED_MDNS_IPV6 ? " mDNS/IPv6" : "");
printf(" protocol%s%s%s%s%s",
flags & SD_RESOLVED_DNS ? " DNS" :"",
flags & SD_RESOLVED_LLMNR_IPV4 ? " LLMNR/IPv4" : "",
flags & SD_RESOLVED_LLMNR_IPV6 ? " LLMNR/IPv6" : "",
flags & SD_RESOLVED_MDNS_IPV4 ? " mDNS/IPv4" : "",
flags & SD_RESOLVED_MDNS_IPV6 ? " mDNS/IPv6" : "");
assert_se(format_timespan(rtt_str, sizeof(rtt_str), rtt, 100));

View File

@ -334,9 +334,6 @@ int ask_password_plymouth(
p += k;
if (p < 1)
continue;
if (buffer[0] == 5) {
if (flags & ASK_PASSWORD_ACCEPT_CACHED) {

View File

@ -109,7 +109,7 @@ static int output_units_list(const UnitInfo *unit_infos, unsigned c) {
(void) table_set_empty_string(table, "-");
for (const UnitInfo *u = unit_infos; unit_infos && u < unit_infos + c; u++) {
for (const UnitInfo *u = unit_infos; unit_infos && u - unit_infos < c; u++) {
_cleanup_free_ char *j = NULL;
const char *on_underline = "", *on_loaded = "", *on_active = "";
const char *on_circle = "", *id;

View File

@ -125,8 +125,7 @@ def document_has_elem_with_text(document, elem, item_repr):
for loc in document.findall(predicate):
if loc.text == item_repr:
return True
else:
return False
return False
def check_documented(document, declarations, stats):
missing = []