qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] add resolutions via command-line


From: Benjamin Herrenschmidt
Subject: Re: [Qemu-devel] [PATCH v2] add resolutions via command-line
Date: Tue, 20 Sep 2016 19:01:39 +1000

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]