Skip to content

Commit

Permalink
net: wifi_cred: Remove extra empty lines
Browse files Browse the repository at this point in the history
Follow net coding style and remove extra new lines between
variable set and checking its value.

Signed-off-by: Jukka Rissanen <[email protected]>
(cherry picked from commit 8deebce)
  • Loading branch information
jukkar authored and dkalowsk committed Dec 9, 2024
1 parent 18845d2 commit e60954d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions subsys/net/lib/wifi_credentials/wifi_credentials.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,13 @@ int wifi_credentials_get_by_ssid_personal_struct(const char *ssid, size_t ssid_l
k_mutex_lock(&wifi_credentials_mutex, K_FOREVER);

idx = lookup_idx(ssid, ssid_len);

if (idx == -1) {
LOG_DBG("Cannot retrieve WiFi credentials, no entry found for the provided SSID");
ret = -ENOENT;
goto exit;
}

ret = wifi_credentials_load_entry(idx, buf, sizeof(struct wifi_credentials_personal));

if (ret) {
LOG_ERR("Failed to load WiFi credentials at index %d, err: %d", idx, ret);
goto exit;
Expand Down Expand Up @@ -169,7 +167,6 @@ int wifi_credentials_set_personal_struct(const struct wifi_credentials_personal
k_mutex_lock(&wifi_credentials_mutex, K_FOREVER);

idx = lookup_idx(creds->header.ssid, creds->header.ssid_len);

if (idx == -1) {
idx = lookup_unused_idx();
if (idx == -1) {
Expand All @@ -180,7 +177,6 @@ int wifi_credentials_set_personal_struct(const struct wifi_credentials_personal
}

ret = wifi_credentials_store_entry(idx, creds, sizeof(struct wifi_credentials_personal));

if (ret) {
LOG_ERR("Failed to store WiFi credentials at index %d, err: %d", idx, ret);
goto exit;
Expand Down Expand Up @@ -340,15 +336,14 @@ int wifi_credentials_delete_by_ssid(const char *ssid, size_t ssid_len)
}

k_mutex_lock(&wifi_credentials_mutex, K_FOREVER);
idx = lookup_idx(ssid, ssid_len);

idx = lookup_idx(ssid, ssid_len);
if (idx == -1) {
LOG_DBG("WiFi credentials entry was not found");
goto exit;
}

ret = wifi_credentials_delete_entry(idx);

if (ret) {
LOG_ERR("Failed to delete WiFi credentials index %d, err: %d", idx, ret);
goto exit;
Expand Down

0 comments on commit e60954d

Please sign in to comment.