Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934199AbbEMC3P (ORCPT ); Tue, 12 May 2015 22:29:15 -0400 Received: from g4t3426.houston.hp.com ([15.201.208.54]:47288 "EHLO g4t3426.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932719AbbEMC3L (ORCPT ); Tue, 12 May 2015 22:29:11 -0400 Message-ID: <5552B6B4.5080206@hp.com> Date: Wed, 13 May 2015 10:28:04 +0800 From: "Li, ZhenHua" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Baoquan He CC: dwmw2@infradead.org, indou.takao@jp.fujitsu.com, joro@8bytes.org, vgoyal@redhat.com, dyoung@redhat.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, kexec@lists.infradead.org, alex.williamson@redhat.com, ddutile@redhat.com, ishii.hironobu@jp.fujitsu.com, bhelgaas@google.com, doug.hatch@hp.com, jerry.hoemann@hp.com, tom.vaden@hp.com, li.zhang6@hp.com, lisa.mitchell@hp.com, billsumnerlinux@gmail.com, rwright@hp.com, "Li, ZhenHua" Subject: Re: [PATCH v11 07/10] iommu/vt-d: enable kdump support in iommu module References: <1431337974-545-1-git-send-email-zhen-hual@hp.com> <1431337974-545-8-git-send-email-zhen-hual@hp.com> <20150513021027.GA3736@dhcp-128-28.nay.redhat.com> In-Reply-To: <20150513021027.GA3736@dhcp-128-28.nay.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1134 Lines: 40 >> +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 thing. But I believe global is better, because if other functions want to know whether translation is enabled, this global variable is a good choice. Thanks Zhenhua -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/