diff mbox series

Remove dead code in wpas_sched_scan_plans_set()

Message ID 72b32b97-9751-40a6-8817-e72d52cbd32c@xv97.com
State Rejected
Headers show
Series Remove dead code in wpas_sched_scan_plans_set() | expand

Commit Message

Chien Wong Aug. 5, 2023, 9:44 a.m. UTC
From 2f859aad66f5d04104382d9504ab31ef8c178577 Mon Sep 17 00:00:00 2001
From: Chien Wong <m@xv97.com>
Date: Sat, 5 Aug 2023 17:32:38 +0800
Subject: [PATCH] Remove dead code in wpas_sched_scan_plans_set()

The scan plans were consumed in the parsing loop. The removed check
is bound to fail.

Signed-off-by: Chien Wong <m@xv97.com>
---
  wpa_supplicant/scan.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

iterations");
          goto fail;

Comments

Chien Wong Aug. 5, 2023, 10:11 a.m. UTC | #1
I would revert the patch.

The removed check is not dead code and is needed.

Sorry to bother.

On 8/5/23 17:44, Chien Wong wrote:
> From 2f859aad66f5d04104382d9504ab31ef8c178577 Mon Sep 17 00:00:00 2001
> From: Chien Wong <m@xv97.com>
> Date: Sat, 5 Aug 2023 17:32:38 +0800
> Subject: [PATCH] Remove dead code in wpas_sched_scan_plans_set()
>
> The scan plans were consumed in the parsing loop. The removed check
> is bound to fail.
>
> Signed-off-by: Chien Wong <m@xv97.com>
> ---
>  wpa_supplicant/scan.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
> index c3984a40c..11c680353 100644
> --- a/wpa_supplicant/scan.c
> +++ b/wpa_supplicant/scan.c
> @@ -3441,7 +3441,7 @@ int wpas_sched_scan_plans_set(struct 
> wpa_supplicant *wpa_s, const char *cmd)
>          goto fail;
>      }
>
> -    if (cstr_token(cmd, " ", &context) || scan_plans[num - 
> 1].iterations) {
> +    if (scan_plans[num - 1].iterations) {
>          wpa_printf(MSG_ERROR,
>                 "All scan plans but the last must specify a number of 
> iterations");
>          goto fail;
diff mbox series

Patch

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index c3984a40c..11c680353 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -3441,7 +3441,7 @@  int wpas_sched_scan_plans_set(struct 
wpa_supplicant *wpa_s, const char *cmd)
          goto fail;
      }

-    if (cstr_token(cmd, " ", &context) || scan_plans[num - 1].iterations) {
+    if (scan_plans[num - 1].iterations) {
          wpa_printf(MSG_ERROR,
                 "All scan plans but the last must specify a number of