Messages in this thread | | | From | "Ren, Qiaowei" <> | Subject | RE: [PATCH] x86, tboot: iomem fixes | Date | Sat, 20 Jul 2013 16:16:42 +0000 |
| |
On 2013-07-20, Ingo Molnar wrote: > > * Qiaowei Ren <qiaowei.ren@intel.com> wrote: > >> +#define SINIT_MLE_DATA_VTD_DMAR_OFF 140 > >> /* get addr of DMAR table */ + dmar_tbl_off = readl(heap_ptr + >> SINIT_MLE_DATA_VTD_DMAR_OFF); dmar_tbl = (struct acpi_table_header >> *)(heap_ptr + >> - ((struct sinit_mle_data *)heap_ptr)->vtd_dmars_off - >> - sizeof(u64)); >> + dmar_tbl_off - sizeof(u64)); > > So the offset of ->vtd_dmars_off within struct sinit_mle_data is 140? > > The new code is less readable: what's wrong with getting the offset > automatically via C, instead of hardcoding it manually? You can use > offsetof() primitive for increased readability. > Ok. Thanks for your suggestion. I will try to use offsetof() to increase readability.
Thanks, Qiaowei
| |