From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Mon, 27 Feb 2012 20:52:25 +0000 Subject: Re: [PATCH v6 1/4] KVM: PPC: epapr: Factor out the epapr init Message-Id: <4F4BED09.1040306@freescale.com> List-Id: References: <1329988942-19610-1-git-send-email-yu.liu@freescale.com> In-Reply-To: <1329988942-19610-1-git-send-email-yu.liu@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Liu Yu Cc: agraf@suse.de, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, linuxppc-dev@ozlabs.org, B07421@freescale.com On 02/23/2012 03:22 AM, Liu Yu wrote: > +static int __init epapr_paravirt_init(void) > +{ > + struct device_node *hyper_node; > + const u32 *insts; > + int len, i; > + > + hyper_node = of_find_node_by_path("/hypervisor"); > + if (!hyper_node) > + return -ENODEV; > + > + insts = of_get_property(hyper_node, "hcall-instructions", &len); > + if (!insts) > + return 0; -ENODEV here too. > + if (!(len % 4) && len <= (4 * 4)) { > + for (i = 0; i < (len / 4); i++) > + patch_instruction(epapr_hypercall_start + i, insts[i]); > + > + epapr_paravirt_enabled = true; > + } else { > + printk(KERN_WARNING > + "ePAPR paravirt: hcall-instructions format error\n"); > + } Do this: if (error) { print error return error code } continue with function Not this: if (!error) { continue with function } else { report the error from several lines back } > @@ -33,6 +34,14 @@ config KVM_GUEST > > In case of doubt, say Y > > +config EPAPR_PARAVIRT > + bool "ePAPR para-virtualization support" > + default n > + help > + Used to enalbe ePAPR complied para-virtualization support for guest. > + > + In case of doubt, say Y s/Used to enalbe/Enable/ s/complied/compliant/ (or just s/complied//) -Scott