From: Julien Grall Subject: [PATCH 1/6] xen/arm: domain_build: Avoid to shadow the variable "mod" in write_properties Date: Tue, 27 Oct 2015 15:39:14 +0000 Message-ID: <1445960359-17217-2-git-send-email-julien.grall@citrix.com> References: <1445960359-17217-1-git-send-email-julien.grall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zr6Mj-0002Kq-6t for xen-devel@lists.xenproject.org; Tue, 27 Oct 2015 15:40:49 +0000 In-Reply-To: <1445960359-17217-1-git-send-email-julien.grall@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Julien Grall , Stefano Stabellini , Ian Campbell List-Id: xen-devel@lists.xenproject.org The variable "mod" is defined twice with different value. This make the code confusing to read. Rename the 2 "mod" in something more meaningful. Signed-off-by: Julien Grall -- Cc: Ian Campbell Cc: Stefano Stabellini --- xen/arch/arm/domain_build.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 0c3441a..0f0f53e 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -407,10 +407,10 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo, int res = 0; int had_dom0_bootargs = 0; - const struct bootmodule *mod = kinfo->kernel_bootmodule; + const struct bootmodule *kernel = kinfo->kernel_bootmodule; - if ( mod && mod->cmdline[0] ) - bootargs = &mod->cmdline[0]; + if ( kernel && kernel->cmdline[0] ) + bootargs = &kernel->cmdline[0]; dt_for_each_property_node (node, prop) { @@ -489,7 +489,7 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo, if ( dt_node_path_is_equal(node, "/chosen") ) { - const struct bootmodule *mod = kinfo->initrd_bootmodule; + const struct bootmodule *initrd = kinfo->initrd_bootmodule; if ( bootargs ) { @@ -503,7 +503,7 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo, * If the bootloader provides an initrd, we must create a placeholder * for the initrd properties. The values will be replaced later. */ - if ( mod && mod->size ) + if ( initrd && initrd->size ) { u64 a = 0; res = fdt_property(kinfo->fdt, "linux,initrd-start", &a, sizeof(a)); -- 2.1.4