Re: [PATCH] introduce lower_32_bits() macro

From: Joerg Roedel
Date: Mon Jul 28 2008 - 06:59:23 EST


On Fri, Jul 25, 2008 at 12:06:27PM -0400, H. Peter Anvin wrote:
> Joerg Roedel wrote:
> >The file kernel.h contains the upper_32_bits macro. This patch adds the other
> >part, the lower_32_bits macro. Its first use will be in the driver for AMD
> >IOMMU.
> >Signed-off-by: Joerg Roedel <joerg.roedel@xxxxxxx>
> >---
> > include/linux/kernel.h | 6 ++++++
> > 1 files changed, 6 insertions(+), 0 deletions(-)
> >diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> >index f9cd7a5..6fd2977 100644
> >--- a/include/linux/kernel.h
> >+++ b/include/linux/kernel.h
> >@@ -73,6 +73,12 @@ extern const char linux_proc_banner[];
> > */
> > #define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
> > +/**
> >+ * lower_32_bits - return bits 0-31 of a number
> >+ * @n: the number we're accessing
> >+ */
> >+#define lower_32_bits(n) ((n) & 0xffffffffULL)
> >+
>
> NAK. These are assymmetric with regards to type, which is the *last*
> thing we want.
>
> The symmetric definition would be ((u32)(n)), but that's already
> idiomatic use, so why not use it as-is?

Ok, true. Sorry for the broken patch. I will send an updated one.

Joerg

--
| AMD Saxony Limited Liability Company & Co. KG
Operating | Wilschdorfer Landstr. 101, 01109 Dresden, Germany
System | Register Court Dresden: HRA 4896
Research | General Partner authorized to represent:
Center | AMD Saxony LLC (Wilmington, Delaware, US)
| General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/