Messages in this thread Patch in this message | | | Subject | [PATCH] lib/crc32.c: to use compiler.h defines | From | Clay Haapala <> | Date | Tue, 27 Apr 2004 14:55:05 -0500 |
| |
On Fri, 23 Apr 2004, David S. Miller told this: > On Mon, 19 Apr 2004 16:37:01 -0500 > Clay Haapala <chaapala@cisco.com> wrote: > >> +#if __GNUC__ >= 3 /* 2.x has "attribute", but only 3.0 has "pure >> +*/ #define attribute(x) __attribute__(x) #else #define >> +attribute(x) #endif > > I was about to apply your two patches, but then I noticed this > thing. WHatever you may need this for exists in linux/compiler.h > and if it doesn't you should add the necessary macro interfaces > there. > > Thanks.
Below is a patch to lib/crc32.c to use the compiler.h define for attribute((pure)). -- Clay Haapala (chaapala@cisco.com) Cisco Systems SRBU +1 763-398-1056 6450 Wedgwood Rd, Suite 130 Maple Grove MN 55311 PGP: C89240AD "Oh, *that* Physics Prize. Well, I just substituted 'stupidity' for 'dark matter' in the equations, and it all came together."
--- linux-2.6.5.orig/lib/crc32.c Sat Apr 3 21:36:14 2004 +++ linux-2.6.5/lib/crc32.c Tue Apr 27 14:48:03 2004 @@ -37,13 +37,6 @@ #endif #include "crc32table.h" -#if __GNUC__ >= 3 /* 2.x has "attribute", but only 3.0 has "pure */ -#define attribute(x) __attribute__(x) -#else -#define attribute(x) -#endif - - MODULE_AUTHOR("Matt Domsch <Matt_Domsch@dell.com>"); MODULE_DESCRIPTION("Ethernet CRC32 calculations"); MODULE_LICENSE("GPL"); @@ -62,7 +55,7 @@ * @len - length of buffer @p * */ -u32 attribute((pure)) crc32_le(u32 crc, unsigned char const *p, size_t len) +u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len) { int i; while (len--) { @@ -82,7 +75,7 @@ * @len - length of buffer @p * */ -u32 attribute((pure)) crc32_le(u32 crc, unsigned char const *p, size_t len) +u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len) { # if CRC_LE_BITS == 8 const u32 *b =(u32 *)p; @@ -165,7 +158,7 @@ * @len - length of buffer @p * */ -u32 attribute((pure)) crc32_be(u32 crc, unsigned char const *p, size_t len) +u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) { int i; while (len--) { @@ -187,7 +180,7 @@ * @len - - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |