mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-24 06:52:37 +01:00
treewide: Comply with doc/coding-style.txt M13
This commit is contained in:
parent
8bb22a722b
commit
4a04d41409
@ -54,7 +54,7 @@ void __iwd_backtrace_print(unsigned int offset)
|
|||||||
int pathlen;
|
int pathlen;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
if (program_exec == NULL)
|
if (!program_exec)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pathlen = strlen(program_path);
|
pathlen = strlen(program_path);
|
||||||
@ -186,7 +186,7 @@ void __iwd_backtrace_init(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (program_exec == NULL)
|
if (!program_exec)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
program_path = getcwd(cwd, sizeof(cwd));
|
program_path = getcwd(cwd, sizeof(cwd));
|
||||||
|
@ -974,7 +974,7 @@ static void __eap_method_enable(struct eap_method_desc *start,
|
|||||||
|
|
||||||
l_debug("");
|
l_debug("");
|
||||||
|
|
||||||
if (start == NULL || stop == NULL)
|
if (!start || !stop)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (desc = start; desc < stop; desc++) {
|
for (desc = start; desc < stop; desc++) {
|
||||||
@ -992,7 +992,7 @@ static void __eap_method_disable(struct eap_method_desc *start,
|
|||||||
|
|
||||||
l_debug("");
|
l_debug("");
|
||||||
|
|
||||||
if (start == NULL || stop == NULL)
|
if (!start || !stop)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (desc = start; desc < stop; desc++) {
|
for (desc = start; desc < stop; desc++) {
|
||||||
|
@ -342,8 +342,7 @@ static bool frame_watch_group_io_read(struct l_io *io, void *user_data)
|
|||||||
|
|
||||||
nlmsg_len = bytes_read;
|
nlmsg_len = bytes_read;
|
||||||
|
|
||||||
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL;
|
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
|
||||||
cmsg = CMSG_NXTHDR(&msg, cmsg)) {
|
|
||||||
struct nl_pktinfo pktinfo;
|
struct nl_pktinfo pktinfo;
|
||||||
|
|
||||||
if (cmsg->cmsg_level != SOL_NETLINK)
|
if (cmsg->cmsg_level != SOL_NETLINK)
|
||||||
|
@ -710,7 +710,7 @@ struct netconfig *netconfig_new(uint32_t ifindex)
|
|||||||
netconfig_commit_init(netconfig);
|
netconfig_commit_init(netconfig);
|
||||||
|
|
||||||
debug_level = getenv("IWD_DHCP_DEBUG");
|
debug_level = getenv("IWD_DHCP_DEBUG");
|
||||||
if (debug_level != NULL) {
|
if (debug_level) {
|
||||||
if (!strcmp("debug", debug_level))
|
if (!strcmp("debug", debug_level))
|
||||||
dhcp_priority = L_LOG_DEBUG;
|
dhcp_priority = L_LOG_DEBUG;
|
||||||
else if (!strcmp("info", debug_level))
|
else if (!strcmp("info", debug_level))
|
||||||
|
@ -596,7 +596,7 @@ struct l_settings *storage_network_open(enum security type, const char *ssid)
|
|||||||
struct l_settings *settings;
|
struct l_settings *settings;
|
||||||
_auto_(l_free) char *path = NULL;
|
_auto_(l_free) char *path = NULL;
|
||||||
|
|
||||||
if (ssid == NULL)
|
if (!ssid)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
path = storage_get_network_file_path(type, ssid);
|
path = storage_get_network_file_path(type, ssid);
|
||||||
@ -623,7 +623,7 @@ int storage_network_touch(enum security type, const char *ssid)
|
|||||||
char *path;
|
char *path;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (ssid == NULL)
|
if (!ssid)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
path = storage_get_network_file_path(type, ssid);
|
path = storage_get_network_file_path(type, ssid);
|
||||||
|
@ -234,8 +234,7 @@ static bool can_read_data(struct l_io *io, void *user_data)
|
|||||||
if (len < 0)
|
if (len < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL;
|
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
|
||||||
cmsg = CMSG_NXTHDR(&msg, cmsg)) {
|
|
||||||
struct nl_pktinfo *pktinfo;
|
struct nl_pktinfo *pktinfo;
|
||||||
|
|
||||||
if (cmsg->cmsg_level != SOL_NETLINK)
|
if (cmsg->cmsg_level != SOL_NETLINK)
|
||||||
|
@ -722,7 +722,7 @@ int wsc_parse_attrs(const unsigned char *pdu, unsigned int len,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e2 == NULL) {
|
if (!e2) {
|
||||||
if (!ext_iter)
|
if (!ext_iter)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ static bool verify_info(const struct dpp_uri_info *parsed,
|
|||||||
|
|
||||||
assert(!memcmp(parsed->mac, expected->mac, 6));
|
assert(!memcmp(parsed->mac, expected->mac, 6));
|
||||||
assert(parsed->version == expected->version);
|
assert(parsed->version == expected->version);
|
||||||
assert(parsed->boot_public != NULL);
|
assert(parsed->boot_public);
|
||||||
|
|
||||||
for (i = 0; result->expected_freqs[i]; i++)
|
for (i = 0; result->expected_freqs[i]; i++)
|
||||||
assert(scan_freq_set_contains(parsed->freqs,
|
assert(scan_freq_set_contains(parsed->freqs,
|
||||||
@ -140,7 +140,7 @@ static void test_uri_parse(const void *data)
|
|||||||
|
|
||||||
info = dpp_parse_uri(test_info->uri);
|
info = dpp_parse_uri(test_info->uri);
|
||||||
if (test_info->expect_fail) {
|
if (test_info->expect_fail) {
|
||||||
assert(info == NULL);
|
assert(!info);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -660,7 +660,7 @@ static void ie_test_concat_wsc(const void *data)
|
|||||||
if (len > 0)
|
if (len > 0)
|
||||||
assert(!memcmp(res, test->expected_data, len));
|
assert(!memcmp(res, test->expected_data, len));
|
||||||
else
|
else
|
||||||
assert(res == NULL);
|
assert(!res);
|
||||||
|
|
||||||
l_free(res);
|
l_free(res);
|
||||||
}
|
}
|
||||||
@ -681,7 +681,7 @@ static void ie_test_encapsulate_wsc(const void *data)
|
|||||||
if (extracted_len > 0)
|
if (extracted_len > 0)
|
||||||
assert(!memcmp(extracted, test->expected_data, extracted_len));
|
assert(!memcmp(extracted, test->expected_data, extracted_len));
|
||||||
else
|
else
|
||||||
assert(extracted == NULL);
|
assert(!extracted);
|
||||||
|
|
||||||
packed = ie_tlv_encapsulate_wsc_payload(extracted, extracted_len,
|
packed = ie_tlv_encapsulate_wsc_payload(extracted, extracted_len,
|
||||||
&packed_len);
|
&packed_len);
|
||||||
|
@ -106,7 +106,7 @@ static void test_json(const void *data)
|
|||||||
JSON_OPTIONAL("objnotfound", JSON_OBJECT, &objnotfound),
|
JSON_OPTIONAL("objnotfound", JSON_OBJECT, &objnotfound),
|
||||||
JSON_UNDEFINED));
|
JSON_UNDEFINED));
|
||||||
|
|
||||||
assert(opt_not_found == NULL);
|
assert(!opt_not_found);
|
||||||
assert(!json_iter_is_valid(&objnotfound));
|
assert(!json_iter_is_valid(&objnotfound));
|
||||||
|
|
||||||
assert(!strcmp(tech, "infra"));
|
assert(!strcmp(tech, "infra"));
|
||||||
|
Loading…
Reference in New Issue
Block a user