On Tue, Jan 25, 2022 at 10:24:49AM -0600, Eric DeVolder wrote: > And here is what the main snippet looks like with the above changes (a diff > is quite messy): > > /* > * Macros for use with construction of the action instructions > */ > #define BUILD_READ_VALUE(width_in_bits) \ > build_serialization_instruction_entry(table_instruction_data, \ > action, INST_READ_REGISTER, 0, width_in_bits, \ > bar0 + ERST_VALUE_OFFSET, 0) > > #define BUILD_READ_VALUE_VALUE(width_in_bits, value) \ > build_serialization_instruction_entry(table_instruction_data, \ > action, INST_READ_REGISTER_VALUE, 0, width_in_bits, \ > bar0 + ERST_VALUE_OFFSET, value) > > #define BUILD_WRITE_REGISTER(width_in_bits, reg, value) \ > build_serialization_instruction_entry(table_instruction_data, \ > action, INST_WRITE_REGISTER, 0, width_in_bits, \ > bar0 + reg, value) > > #define BUILD_WRITE_REGISTER_VALUE(width_in_bits, reg, value) \ > build_serialization_instruction_entry(table_instruction_data, \ > action, INST_WRITE_REGISTER_VALUE, 0, width_in_bits, \ > bar0 + reg, value)
Please, don't hide variable accesses in macros like that. whatever is accessed should be part of a parameter. -- MST