Content-Type: multipart/mixed; boundary="===============2781594944349767354==" MIME-Version: 1.0 From: ramesh.thomas at intel.com Subject: [Accel-config] [PATCH v1 5/7] accel-config: Print device command status only on errors Date: Tue, 02 Mar 2021 12:44:40 -0500 Message-ID: <20210302174442.206008-6-ramesh.thomas@intel.com> In-Reply-To: 20210302174442.206008-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============2781594944349767354== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ramesh Thomas Skip printing "Success" message when there is no device command error status recorded as this is called in the context of error conditions returned by library. Signed-off-by: Ramesh Thomas --- accfg/enable.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/accfg/enable.c b/accfg/enable.c index d3968e4..8abbaca 100644 --- a/accfg/enable.c +++ b/accfg/enable.c @@ -85,9 +85,11 @@ static void print_device_cmd_status(struct accfg_device = *device) { const char *status; = - status =3D accfg_device_get_cmd_status_str(device); - if (status) - fprintf(stderr, "device command status: %s\n", status); + if (accfg_device_get_cmd_status(device) > 0) { + status =3D accfg_device_get_cmd_status_str(device); + if (status) + fprintf(stderr, "device command status: %s\n", status); + } } = static int device_action(int argc, const char **argv, const char *usage, -- = 2.26.2 --===============2781594944349767354==--