Subject: Re: [PATCH v2] powerpc: add setmaskedbits macros

From: Timur Tabi <[email-masked]>
Date: Thu, 16 Aug 2007 10:27:31 -0500

Michael Ellerman wrote:

> And if you're going to the trouble of making a macro, why not make it a
> bit more useful and have it check that the value and the mask match, ie:
> 
> (v & ~m == 0)

What should I do if it fails this check?

> Final random thought, you could make the size/endian an argument:
> 
> #define setmaskedbits(a, v, m, s)  out_##s((a), (in_##s(a) & ~(m) | (v))

Hmmm.... the only thing wrong with that is that it would allow be64 on a 
32-bit platform (i.e. no __power64__ protection).  But that's minor.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale