[lkml]   [2015]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v11 07/10] iommu/vt-d: enable kdump support in iommu module
>> +static u8 g_translation_pre_enabled;
> Hi Zhenhua,
> I haven't checked patch one by one, am going through the code flow.
> About g_translation_pre_enabled, I don't think it's necessary to define
> it as a global variable. Both its assignment and judgement are in
> init_dmars(). In this situation a local variable translation_pre_enabled
> in init_dmars() is enough.
> You can assign value to it here:
> iommu_check_pre_te_status(iommu);
> if (iommu->pre_enabled_trans) {
> translation_pre_enabled = 1;
> ...
> }
> Thanks
> Baoquan
Hi Baoquan,
This variable is only be used in this file, for it is defined as static.
Till now, I think both global and local variable are fine, got the same
But I believe global is better, because if other functions want to know
whether translation is enabled, this global variable is a good choice.


 \ /
  Last update: 2015-05-13 04:41    [W:0.081 / U:0.792 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site