From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: G 3 <programmingkidx@gmail.com>
Cc: "list@suse.de:PowerPC list:PowerPC" <qemu-ppc@nongnu.org>,
qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2] add resolutions via command-line
Date: Tue, 20 Sep 2016 19:01:13 +1000 [thread overview]
Message-ID: <1474362073.2857.59.camel@kernel.crashing.org> (raw)
In-Reply-To: <DDAFD321-BBFA-4299-8310-BE0B52B7C601@gmail.com>
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.
next prev parent reply other threads:[~2016-09-20 9:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-20 4:28 [Qemu-devel] [PATCH v2] add resolutions via command-line G 3
2016-09-20 9:01 ` Benjamin Herrenschmidt [this message]
2016-09-20 9:01 ` Benjamin Herrenschmidt
2016-09-20 13:07 ` G 3
2016-09-20 13:37 ` Eric Blake
2016-09-20 13:51 ` G 3
2016-09-20 21:57 ` Benjamin Herrenschmidt
2016-09-21 0:17 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1474362073.2857.59.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=programmingkidx@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.