Adrian Hunter wrote: [..] > Another possibility is to put the macro at the invocation site: > > #define READ_SYS_INFO(_field_id, _member) \ > ret = ret ?: read_sys_metadata_field16(MD_FIELD_ID_##_field_id, \ > &sysinfo_tdmr->_member) > > READ_SYS_INFO(MAX_TDMRS, max_tdmrs); > READ_SYS_INFO(MAX_RESERVED_PER_TDMR, max_reserved_per_tdmr); > READ_SYS_INFO(PAMT_4K_ENTRY_SIZE, pamt_entry_size[TDX_PS_4K]); > READ_SYS_INFO(PAMT_2M_ENTRY_SIZE, pamt_entry_size[TDX_PS_2M]); > READ_SYS_INFO(PAMT_1G_ENTRY_SIZE, pamt_entry_size[TDX_PS_1G]); > > #undef READ_SYS_INFO > > And so on in later patches: > > #define READ_SYS_INFO(_field_id, _member) \ > ret = ret ?: read_sys_metadata_field(MD_FIELD_ID_##_field_id, \ > &sysinfo_version->_member) > > READ_SYS_INFO(MAJOR_VERSION, major); > READ_SYS_INFO(MINOR_VERSION, minor); > READ_SYS_INFO(UPDATE_VERSION, update); > READ_SYS_INFO(INTERNAL_VERSION, internal); > READ_SYS_INFO(BUILD_NUM, build_num); > READ_SYS_INFO(BUILD_DATE, build_date); > > #undef READ_SYS_INFO Looks like a reasonable enhancement to me.