On power platforms we can find
 # cat /sys/devices/system/memory/memory0/phys_index
00000000

This results in

libdaxctl: memblock_in_dev: dax1.0: memory0: Unable to determine phys_index: 
Success

Avoid considering phys_index == 0 as error.

Signed-off-by: Aneesh Kumar K.V <[email protected]>
---
 daxctl/lib/libdaxctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/daxctl/lib/libdaxctl.c b/daxctl/lib/libdaxctl.c
index ee4a069eb463..3cb89c755978 100644
--- a/daxctl/lib/libdaxctl.c
+++ b/daxctl/lib/libdaxctl.c
@@ -1229,7 +1229,7 @@ static int memblock_in_dev(struct daxctl_memory *mem, 
const char *memblock)
        rc = sysfs_read_attr(ctx, path, buf);
        if (rc == 0) {
                phys_index = strtoul(buf, NULL, 16);
-               if (phys_index == 0 || phys_index == ULONG_MAX) {
+               if (phys_index == ULONG_MAX) {
                        rc = -errno;
                        err(ctx, "%s: %s: Unable to determine phys_index: %s\n",
                                devname, memblock, strerror(-rc));
-- 
2.26.2
_______________________________________________
Linux-nvdimm mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to