From: Timur Tabi <timur@freescale.com>
To: michael@ellerman.id.au
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org
Subject: Re: [PATCH v2] powerpc: add setmaskedbits macros
Date: Thu, 16 Aug 2007 10:27:31 -0500 [thread overview]
Message-ID: <46C46CE3.5030807@freescale.com> (raw)
In-Reply-To: <1187236548.8375.13.camel@concordia.ozlabs.ibm.com>
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
prev parent reply other threads:[~2007-08-16 15:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-15 21:30 [PATCH v2] powerpc: add setmaskedbits macros Timur Tabi
2007-08-16 3:22 ` Kumar Gala
2007-08-16 15:18 ` Timur Tabi
2007-08-16 15:21 ` Kumar Gala
2007-08-16 15:26 ` Timur Tabi
2007-08-16 16:40 ` Benjamin Herrenschmidt
2007-08-16 17:45 ` Timur Tabi
2007-08-16 3:55 ` Michael Ellerman
2007-08-16 7:19 ` Geert Uytterhoeven
2007-08-16 15:27 ` Timur Tabi [this message]
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=46C46CE3.5030807@freescale.com \
--to=timur@freescale.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=michael@ellerman.id.au \
--cc=paulus@samba.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.