From fd3aa072099d554fa4e05e214a395408c82b19ef Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Wed, 30 May 2018 15:23:37 +0200 Subject: [PATCH] print_fields.h: introduce PRINT_FIELD_XVAL_SORTED_SIZED For those cases when array definition is not readily available and should be provided separately. * print_fields.h (PRINT_FIELD_XVAL_SORTED_SIZED): New macro. --- print_fields.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/print_fields.h b/print_fields.h index 2e025768..ffcabf46 100644 --- a/print_fields.h +++ b/print_fields.h @@ -99,6 +99,15 @@ (xlat_), NULL); \ } while (0) +#define PRINT_FIELD_XVAL_SORTED_SIZED(prefix_, where_, field_, xlat_, \ + xlat_size_, dflt_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + printxval_searchn((xlat_), (xlat_size_), \ + zero_extend_signed_to_ull((where_).field_), \ + (dflt_)); \ + } while (0) + #define PRINT_FIELD_XVAL_INDEX(prefix_, where_, field_, xlat_, dflt_) \ do { \ STRACE_PRINTF("%s%s=", (prefix_), #field_); \ -- 2.40.0