Content-Type: multipart/mixed; boundary="===============5897473836729203147==" MIME-Version: 1.0 From: ramesh.thomas at intel.com Subject: [Accel-config] [PATCH v1 6/7] accel-config: Remove redundant check of wq state Date: Tue, 02 Mar 2021 12:44:41 -0500 Message-ID: <20210302174442.206008-7-ramesh.thomas@intel.com> In-Reply-To: 20210302174442.206008-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============5897473836729203147== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ramesh Thomas Functions that enable and disable wqs already verify state post operation and return error if does not match the requested state. Checking here again when success is returned will miss incrementing the fail count. Signed-off-by: Ramesh Thomas --- accfg/enable.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/accfg/enable.c b/accfg/enable.c index 8abbaca..642e30a 100644 --- a/accfg/enable.c +++ b/accfg/enable.c @@ -247,7 +247,6 @@ static int wq_action(int argc, const char **argv, const= char *usage, unsigned long dev_id, wq_id; int i, rc =3D 0, success =3D 0, fail =3D 0, fail_reason =3D 0; const char *all =3D "all"; - enum accfg_wq_state state; = argc =3D parse_options(argc, argv, options, u, 0); = @@ -293,17 +292,9 @@ static int wq_action(int argc, const char **argv, cons= t char *usage, found++; rc =3D wq_action_switch(wq, action, wq_name); if (rc =3D=3D 0) { - /* - * Double check if the state of the - * wq matches with the enable/disable - */ - state =3D accfg_wq_get_state(wq); - if (((state =3D=3D 1) && (action =3D=3D WQ_ACTION_ENABLE)) - ||((state =3D=3D 0) && (action =3D=3D WQ_ACTION_DISABLE))) - success++; - else - fail++; - } else if (!fail) { + success++; + } else { + fail++; fail_reason =3D rc; fprintf(stderr, "failed in %s\n", wq_name); = -- = 2.26.2 --===============5897473836729203147==--