Received: from eggs.gnu.org ([2001:4830:134:3::10]:44757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmGwA-0004qB-3C for qemu-devel@nongnu.org; Tue, 20 Sep 2016 05:01:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmGw5-0001Sk-6O for qemu-devel@nongnu.org; Tue, 20 Sep 2016 05:01:57 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49303 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmGw5-0001S9-1r for qemu-devel@nongnu.org; Tue, 20 Sep 2016 05:01:53 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8K8wT3C074837 for ; Tue, 20 Sep 2016 05:01:52 -0400 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0a-001b2d01.pphosted.com with ESMTP id 25juegxsav-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 20 Sep 2016 05:01:51 -0400 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 20 Sep 2016 19:01:46 +1000 From: Benjamin Herrenschmidt Reply-To: benh@au1.ibm.com Date: Tue, 20 Sep 2016 19:01:39 +1000 In-Reply-To: <1474362073.2857.59.camel@kernel.crashing.org> References: <1474362073.2857.59.camel@kernel.crashing.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Message-Id: <1474362099.2857.60.camel@au1.ibm.com> Subject: Re: [Qemu-devel] [PATCH v2] add resolutions via command-line List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: G 3 Cc: "list@suse.de:PowerPC list:PowerPC" , qemu-devel qemu-devel Also .. your patch was all HTML and email-damaged... On Tue, 2016-09-20 at 19:01 +1000, Benjamin Herrenschmidt wrote: > On Tue, 2016-09-20 at 00:28 -0400, G 3 wrote: > > > + RegEntryID *entry_id; > > + OSErr err; > > + OSStatus os_status = noErr; > > + Boolean is_done; > > + void *value; > > + RegPropertyValueSize property_size = -1; > > + int index, res_set_count; > > + char *set_str; > > + > > + #define PROPERTY_NAME "resolutions" > > + #define NODE_PATH "Devices:device-tree:options" > > + > > + /* init the entry variable */ > > + err = RegistryEntryIDInit(entry_id); > > + if (err != noErr) { > > + lprintf("Error: Failed to init entry variable! > > (Error: %d)\n", err); > > + return err; > > + } > > + is_done = false; > > + > > No, you need to allocate the RegistryEntryID on the stack otherwise > you are whacking at a random uninitialized pointer. IE: > > RegistryEntryID entry_id; > > RegistryEntryIDInit(&entry_id); > .../... > > See if that helps with your OS X problem. Also I don't like the > use of pow(), there must be a better way ... Check if there's > anything > of value to be picked up from DSL, otherwise, put those utilities > somewhere in common, other drivers might want them. > > (What does our lprintf implementation do for example ?) > > Cheers, > Ben.