Re: [spice-server 1/3] utils: Remove get/set/clear_bit

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

 



> On Thu, Oct 04, 2018 at 01:42:23PM -0400, Frediano Ziglio wrote:
> > > -static inline void set_bit(int index, uint32_t *addr)
> > > -{
> > > -    uint32_t mask = 1 << index;
> > > -    __sync_or_and_fetch(addr, mask);
> > > -}
> > > -
> > > -static inline void clear_bit(int index, uint32_t *addr)
> > > -{
> > > -    uint32_t mask = ~(1 << index);
> > > -    __sync_and_and_fetch(addr, mask);
> > > -}
> > > -
> > > -static inline int test_bit(int index, uint32_t val)
> > > -{
> > > -    return val & (1u << index);
> > > -}
> > >  /* a generic safe for loop macro  */
> > >  #define SAFE_FOREACH(link, next, cond, ring, data, get_data)
> > >  \
> > >      for ((((link) = ((cond) ? ring_get_head(ring) : NULL)),
> > >      \
> > 
> > I prefer them in utils.h, they don't have something to do specifically
> > with qxl interface.
> 
> That's true, on the other hand, these are not methods we want to use
> outside of the QXL interface.
> 
> Christophe
> 

I prefer them in utils.h.

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]