aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorClay Haapala <chaapala@cisco.com>2004-04-27 22:30:17 -0700
committerDavid S. Miller <davem@nuts.davemloft.net>2004-04-27 22:30:17 -0700
commit7cf5ff202627803e9bdd8c924f572eb8104cc3b8 (patch)
tree1630b3754ba835014c923964d6efe589fb2e0677 /lib
parent37574f10f10a5dcc5809e6f99d9cb973be4c4991 (diff)
downloadhistory-7cf5ff202627803e9bdd8c924f572eb8104cc3b8.tar.gz
[LIB]: Use compiler.h's pure attribute macros in crc32.c.
Diffstat (limited to 'lib')
-rw-r--r--lib/crc32.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/crc32.c b/lib/crc32.c
index 33c33fdd5bf17f..58b222783f9c92 100644
--- a/lib/crc32.c
+++ b/lib/crc32.c
@@ -23,6 +23,7 @@
#include <linux/crc32.h>
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/init.h>
@@ -37,13 +38,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 +56,7 @@ MODULE_LICENSE("GPL");
* @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 +76,7 @@ u32 attribute((pure)) crc32_le(u32 crc, unsigned char const *p, size_t len)
* @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 +159,7 @@ u32 attribute((pure)) crc32_le(u32 crc, unsigned char const *p, size_t len)
* @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 +181,7 @@ u32 attribute((pure)) crc32_be(u32 crc, unsigned char const *p, size_t len)
* @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)
{
# if CRC_BE_BITS == 8
const u32 *b =(u32 *)p;