Combine multiple function calls to a single statement
This cleans up p2p_ctrl_group_add() to share a single call to wpas_p2p_group_add(). Signed-off-by: Purushottam Kushwaha <p.kushwaha@samsung.com>
This commit is contained in:
parent
13b3497245
commit
e11776a528
1 changed files with 9 additions and 9 deletions
|
@ -5523,7 +5523,7 @@ static int p2p_ctrl_group_add_persistent(struct wpa_supplicant *wpa_s,
|
||||||
|
|
||||||
static int p2p_ctrl_group_add(struct wpa_supplicant *wpa_s, char *cmd)
|
static int p2p_ctrl_group_add(struct wpa_supplicant *wpa_s, char *cmd)
|
||||||
{
|
{
|
||||||
int freq = 0, ht40, vht;
|
int freq = 0, persistent_group = 0, ht40, vht;
|
||||||
char *pos;
|
char *pos;
|
||||||
|
|
||||||
pos = os_strstr(cmd, "freq=");
|
pos = os_strstr(cmd, "freq=");
|
||||||
|
@ -5539,15 +5539,15 @@ static int p2p_ctrl_group_add(struct wpa_supplicant *wpa_s, char *cmd)
|
||||||
ht40, vht);
|
ht40, vht);
|
||||||
if (os_strcmp(cmd, "persistent") == 0 ||
|
if (os_strcmp(cmd, "persistent") == 0 ||
|
||||||
os_strncmp(cmd, "persistent ", 11) == 0)
|
os_strncmp(cmd, "persistent ", 11) == 0)
|
||||||
return wpas_p2p_group_add(wpa_s, 1, freq, ht40, vht);
|
persistent_group = 1;
|
||||||
if (os_strncmp(cmd, "freq=", 5) == 0)
|
|
||||||
return wpas_p2p_group_add(wpa_s, 0, freq, ht40, vht);
|
|
||||||
if (ht40)
|
|
||||||
return wpas_p2p_group_add(wpa_s, 0, freq, ht40, vht);
|
|
||||||
|
|
||||||
wpa_printf(MSG_DEBUG, "CTRL: Invalid P2P_GROUP_ADD parameters '%s'",
|
if (!persistent_group && !freq && !ht40) {
|
||||||
cmd);
|
wpa_printf(MSG_DEBUG,
|
||||||
return -1;
|
"CTRL: Invalid P2P_GROUP_ADD parameters '%s'", cmd);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return wpas_p2p_group_add(wpa_s, persistent_group, freq, ht40, vht);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue