lkml.org 
[lkml]   [2013]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] x86, tboot: iomem fixes
Date
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



\
 
 \ /
  Last update: 2013-07-20 19:01    [W:0.046 / U:0.928 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site