diff mbox series

[RFC,ndctl,6/9] test/libndctl: Don't check for two formats on a dimm

Message ID 20201007042256.1110626-6-santosh@fossix.org (mailing list archive)
State New, archived
Headers show
Series [RFC,ndctl,1/9] libndctl: test enablement for non-nfit devices | expand

Commit Message

Santosh Sivaraj Oct. 7, 2020, 4:22 a.m. UTC
The number of formats is itself populated only when there is a nfit
bus present. So skip this sub-test for all other platforms.

Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
---
 test/libndctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/test/libndctl.c b/test/libndctl.c
index 93cbc7a..aaa72dc 100644
--- a/test/libndctl.c
+++ b/test/libndctl.c
@@ -2543,7 +2543,8 @@  static int check_dimms(struct ndctl_bus *bus, struct dimm *dimms, int n,
 			return -ENXIO;
 		}
 
-		if (ndctl_test_attempt(test, KERNEL_VERSION(4, 7, 0))) {
+		if (ndctl_test_attempt(test, KERNEL_VERSION(4, 7, 0)) &&
+		    ndctl_bus_has_nfit(bus)) {
 			if (ndctl_dimm_get_formats(dimm) != dimms[i].formats) {
 				fprintf(stderr, "dimm%d expected formats: %d got: %d\n",
 						i, dimms[i].formats,