Content-Type: multipart/mixed; boundary="===============7874952307247097393==" MIME-Version: 1.0 From: ramesh.thomas at intel.com Subject: [Accel-config] [PATCH v1] accel-config: Skip printing error if cmd status register is not set Date: Tue, 23 Feb 2021 16:14:28 -0500 Message-ID: <20210223211428.189437-1-ramesh.thomas@intel.com> To: accel-config@lists.01.org List-ID: --===============7874952307247097393== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ramesh Thomas Library functions do their own checking and return errors without issuing commands to the hardware. Command status register retrieved from "cmd_status" sysfs attribute may not be set in such cases. Return NULL from function that retrieves the error status to indicate this. Signed-off-by: Ramesh Thomas --- accfg/lib/libaccfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accfg/lib/libaccfg.c b/accfg/lib/libaccfg.c index ae862f8..7d5e9f4 100644 --- a/accfg/lib/libaccfg.c +++ b/accfg/lib/libaccfg.c @@ -1469,7 +1469,7 @@ ACCFG_EXPORT const char * accfg_device_get_cmd_status= _str(struct accfg_device *d const char *stat_str; = status =3D accfg_device_get_cmd_status(device); - if (status < 0) + if (status <=3D 0) return NULL; = if (status > ACCFG_CMD_STATUS_MAX) -- = 2.26.2 --===============7874952307247097393==--