[Spice-devel] [RFC 06/33] partially replace outb with ioport_write

Alon Levy alevy at redhat.com
Thu Apr 28 07:27:56 PDT 2011


On Thu, Apr 28, 2011 at 04:14:38PM +0200, Christophe Fergeau wrote:
> On Wed, Apr 27, 2011 at 06:55:55PM +0300, Alon Levy wrote:
> > replace everywhere it is needed for xspice - places left out are ifdefed
> > out later based on the same define mentioned in qxl.h, XSPICE.
> > 
> > note: leave spaces between function name and open paren?
> > 
> > note2: ioport_write is added at the end of the file because the xspice implementation
> > will need access to the qxl_screen_t typedef, defined earlier in qxl.h .
> 
> I think this note isn't relevant to this patch.

The point was not to put it in the end in this patch unexplained, and then later when
I add an #else to the #ifndef XSPICE below with a declaration using qxl_screen_t add the
explanation. But if I use a static inline here like you suggest below it solves the issue, and
makes it obvious why it needs to come after the qxl_screen_t typedef.

I'll send a revision.

> 
> > diff --git a/src/qxl.h b/src/qxl.h
> > index 99dfecf..9683966 100644
> > --- a/src/qxl.h
> > +++ b/src/qxl.h
> > @@ -335,4 +335,8 @@ void *            qxl_allocnf          (qxl_screen_t           *qxl,
> >  					unsigned long           size);
> >  int		   qxl_garbage_collect (qxl_screen_t *qxl);
> >  
> > +#ifndef XSPICE
> > +#define ioport_write(qxl, port, val) outb(qxl->io_base + port, val)
> > +#endif
> 
> Since the beginning of the patch series is just cleanups/preparation for
> the real XSPICE work, I wouldn't put the #ifndef in this one. Also I'd
> prefer to have a real static function here instead of a #define
> 
> Christophe




More information about the Spice-devel mailing list