[Accel-config] [PATCH] accel-config: clearify set field error output
Dave Jiang <dave.jiang at intel.com> Mon, 21 Mar 2022 15:01:36 -0700
| Newsgroups | dev.linux.lists.accel-config |
|---|---|
| Message-ID | < <164790009679.2821659.9948803765799049525.stgit@djiang5-desk3.ch.intel.com>> |
Present a more clearer error message on what attribute failed to be written.
Signed-off-by: Dave Jiang <dave.jiang(a)intel.com>
---
accfg/lib/libaccfg.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/accfg/lib/libaccfg.c b/accfg/lib/libaccfg.c
index d9c1140e213d..f39bf788cefe 100644
--- a/accfg/lib/libaccfg.c
+++ b/accfg/lib/libaccfg.c
@@ -1923,8 +1923,9 @@ ACCFG_EXPORT int accfg_group_set_##field( \
return -errno; \
} \
if (sysfs_write_attr(ctx, path, buf) < 0) { \
- err(ctx, "%s: write failed: %s\n", \
+ err(ctx, "%s: %s attribute write failed: %s\n", \
accfg_group_get_devname(group), \
+ #field, \
strerror(errno)); \
save_last_error(group->device, NULL, group, NULL); \
return -errno; \
@@ -2381,8 +2382,9 @@ ACCFG_EXPORT int accfg_wq_set_##field( \
} \
} \
if (sysfs_write_attr(ctx, path, buf) < 0) { \
- err(ctx, "%s: write failed: %s\n", \
+ err(ctx, "%s: %s attribute write failed: %s\n", \
accfg_wq_get_devname(wq), \
+ #field, \
strerror(errno)); \
save_last_error(wq->device, wq, NULL, NULL); \
return -errno; \
@@ -2607,8 +2609,9 @@ ACCFG_EXPORT int accfg_engine_set_##field( \
return -errno; \
} \
if (sysfs_write_attr(ctx, path, buf) < 0) { \
- err(ctx, "%s: write failed: %s\n", \
+ err(ctx, "%s: %s attribute write failed: %s\n", \
accfg_engine_get_devname(engine), \
+ #field, \
strerror(errno)); \
save_last_error(engine->device, NULL, NULL, engine); \
return -errno; \