Content-Type: multipart/mixed; boundary="===============7528860287823582100==" MIME-Version: 1.0 From: Dave Jiang Subject: [Accel-config] Re: [PATCH v1] accel-config: Skip printing error if cmd status register is not set Date: Tue, 23 Feb 2021 14:39:49 -0700 Message-ID: <9a07982d-1992-8486-6db7-12ceba6c9e01@intel.com> In-Reply-To: 20210223211428.189437-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============7528860287823582100== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 2/23/2021 2:14 PM, ramesh.thomas(a)intel.com wrote: > 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_stat= us_str(struct accfg_device *d > const char *stat_str; > = > status =3D accfg_device_get_cmd_status(device); > - if (status < 0) > + if (status <=3D 0) Would it be better to just return CMD_SUCCESS or something? > return NULL; > = > if (status > ACCFG_CMD_STATUS_MAX) --===============7528860287823582100==--