Browse Source

xlat_idx: do not issue warnings for holes in indices

Some xlat indices like evdev_abs have holes, avoid issuing warnings
about them.

* xlat.c (xlat_idx): Do not issue warnings for holes in the index.
Dmitry V. Levin 11 months ago
parent
commit
b967e34d70
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      xlat.c

+ 3
- 0
xlat.c View File

@@ -249,6 +249,9 @@ xlat_idx(const struct xlat *xlat, size_t nmemb, uint64_t val)
249 249
 		return NULL;
250 250
 
251 251
 	if (val != pos[val].val) {
252
+		if (pos[val].val == 0)
253
+			return NULL;	/* a hole in the index */
254
+
252 255
 		error_func_msg("Unexpected xlat value %" PRIu64
253 256
 			       " at index %" PRIu64,
254 257
 			       pos[val].val, val);

Loading…
Cancel
Save