diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-26 19:34:08 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-26 19:34:08 -0400 |
commit | 0160daf8cefb44ee8cde9dc5be4d7abd124c3192 (patch) | |
tree | 9842cc99d18479c9213a58303be1034a1ef0ad74 | |
parent | 31370f7e57b5a9f95457fb583354474f7e39fa3e (diff) |
Staging: csr: csr_macro.h: remove unused macros
Remove a bunch of unused #defines.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/csr/csr_macro.h | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/drivers/staging/csr/csr_macro.h b/drivers/staging/csr/csr_macro.h index 3dcb2bd9275..d78ac51dacc 100644 --- a/drivers/staging/csr/csr_macro.h +++ b/drivers/staging/csr/csr_macro.h | |||
@@ -16,18 +16,6 @@ | |||
16 | #define TRUE (1) | 16 | #define TRUE (1) |
17 | 17 | ||
18 | /*------------------------------------------------------------------*/ | 18 | /*------------------------------------------------------------------*/ |
19 | /* Bits - intended to operate on u32 values */ | ||
20 | /*------------------------------------------------------------------*/ | ||
21 | #define CSR_MASK_IS_SET(val, mask) (((val) & (mask)) == (mask)) | ||
22 | #define CSR_MASK_IS_UNSET(val, mask) ((((val) & (mask)) ^ mask) == (mask)) | ||
23 | #define CSR_MASK_SET(val, mask) ((val) |= (mask)) | ||
24 | #define CSR_MASK_UNSET(val, mask) ((val) = ((val) ^ (mask)) & (val)) /* Unsets the bits in val that are set in mask */ | ||
25 | #define CSR_BIT_IS_SET(val, bit) ((u8) ((((val) & (1UL << (bit))) != 0))) | ||
26 | #define CSR_BIT_SET(val, bit) ((val) |= (1UL << (bit))) | ||
27 | #define CSR_BIT_UNSET(val, bit) ((val) &= ~(1UL << (bit))) | ||
28 | #define CSR_BIT_TOGGLE(val, bit) ((val) ^= (1UL << (bit))) | ||
29 | |||
30 | /*------------------------------------------------------------------*/ | ||
31 | /* Endian conversion */ | 19 | /* Endian conversion */ |
32 | /*------------------------------------------------------------------*/ | 20 | /*------------------------------------------------------------------*/ |
33 | #define CSR_GET_UINT16_FROM_LITTLE_ENDIAN(ptr) (((u16) ((u8 *) (ptr))[0]) | ((u16) ((u8 *) (ptr))[1]) << 8) | 21 | #define CSR_GET_UINT16_FROM_LITTLE_ENDIAN(ptr) (((u16) ((u8 *) (ptr))[0]) | ((u16) ((u8 *) (ptr))[1]) << 8) |
@@ -39,59 +27,10 @@ | |||
39 | ((u8 *) (ptr))[1] = ((u8) (((uint) >> 8) & 0x000000FF)); \ | 27 | ((u8 *) (ptr))[1] = ((u8) (((uint) >> 8) & 0x000000FF)); \ |
40 | ((u8 *) (ptr))[2] = ((u8) (((uint) >> 16) & 0x000000FF)); \ | 28 | ((u8 *) (ptr))[2] = ((u8) (((uint) >> 16) & 0x000000FF)); \ |
41 | ((u8 *) (ptr))[3] = ((u8) (((uint) >> 24) & 0x000000FF)) | 29 | ((u8 *) (ptr))[3] = ((u8) (((uint) >> 24) & 0x000000FF)) |
42 | #define CSR_GET_UINT16_FROM_BIG_ENDIAN(ptr) (((u16) ((u8 *) (ptr))[1]) | ((u16) ((u8 *) (ptr))[0]) << 8) | ||
43 | #define CSR_GET_UINT24_FROM_BIG_ENDIAN(ptr) (((u32) ((u8 *) (ptr))[2]) | \ | ||
44 | ((u32) ((u8 *) (ptr))[1]) << 8 | ((u32) ((u8 *) (ptr))[0]) << 16) | ||
45 | #define CSR_GET_UINT32_FROM_BIG_ENDIAN(ptr) (((u32) ((u8 *) (ptr))[3]) | ((u32) ((u8 *) (ptr))[2]) << 8 | \ | ||
46 | ((u32) ((u8 *) (ptr))[1]) << 16 | ((u32) ((u8 *) (ptr))[0]) << 24) | ||
47 | #define CSR_COPY_UINT16_TO_BIG_ENDIAN(uint, ptr) ((u8 *) (ptr))[1] = ((u8) ((uint) & 0x00FF)); \ | ||
48 | ((u8 *) (ptr))[0] = ((u8) ((uint) >> 8)) | ||
49 | #define CSR_COPY_UINT24_TO_BIG_ENDIAN(uint, ptr) ((u8 *) (ptr))[2] = ((u8) ((uint) & 0x000000FF)); \ | ||
50 | ((u8 *) (ptr))[1] = ((u8) (((uint) >> 8) & 0x000000FF)); \ | ||
51 | ((u8 *) (ptr))[0] = ((u8) (((uint) >> 16) & 0x000000FF)) | ||
52 | #define CSR_COPY_UINT32_TO_BIG_ENDIAN(uint, ptr) ((u8 *) (ptr))[3] = ((u8) ((uint) & 0x000000FF)); \ | ||
53 | ((u8 *) (ptr))[2] = ((u8) (((uint) >> 8) & 0x000000FF)); \ | ||
54 | ((u8 *) (ptr))[1] = ((u8) (((uint) >> 16) & 0x000000FF)); \ | ||
55 | ((u8 *) (ptr))[0] = ((u8) (((uint) >> 24) & 0x000000FF)) | ||
56 | |||
57 | /*------------------------------------------------------------------*/ | ||
58 | /* XAP conversion macros */ | ||
59 | /*------------------------------------------------------------------*/ | ||
60 | |||
61 | #define CSR_LSB16(a) ((u8) ((a) & 0x00ff)) | ||
62 | #define CSR_MSB16(b) ((u8) ((b) >> 8)) | ||
63 | |||
64 | #define CSR_CONVERT_8_FROM_XAP(output, input) \ | ||
65 | (output) = ((u8) (input));(input) += 2 | ||
66 | |||
67 | #define CSR_CONVERT_16_FROM_XAP(output, input) \ | ||
68 | (output) = (u16) ((((u16) (input)[1]) << 8) | \ | ||
69 | ((u16) (input)[0]));(input) += 2 | ||
70 | |||
71 | #define CSR_CONVERT_32_FROM_XAP(output, input) \ | ||
72 | (output) = (((u32) (input)[1]) << 24) | \ | ||
73 | (((u32) (input)[0]) << 16) | \ | ||
74 | (((u32) (input)[3]) << 8) | \ | ||
75 | ((u32) (input)[2]);input += 4 | ||
76 | |||
77 | #define CSR_ADD_UINT8_TO_XAP(output, input) \ | ||
78 | (output)[0] = (input); \ | ||
79 | (output)[1] = 0;(output) += 2 | ||
80 | |||
81 | #define CSR_ADD_UINT16_TO_XAP(output, input) \ | ||
82 | (output)[0] = ((u8) ((input) & 0x00FF)); \ | ||
83 | (output)[1] = ((u8) ((input) >> 8));(output) += 2 | ||
84 | |||
85 | #define CSR_ADD_UINT32_TO_XAP(output, input) \ | ||
86 | (output)[0] = ((u8) (((input) >> 16) & 0x00FF)); \ | ||
87 | (output)[1] = ((u8) ((input) >> 24)); \ | ||
88 | (output)[2] = ((u8) ((input) & 0x00FF)); \ | ||
89 | (output)[3] = ((u8) (((input) >> 8) & 0x00FF));(output) += 4 | ||
90 | 30 | ||
91 | /*------------------------------------------------------------------*/ | 31 | /*------------------------------------------------------------------*/ |
92 | /* Misc */ | 32 | /* Misc */ |
93 | /*------------------------------------------------------------------*/ | 33 | /*------------------------------------------------------------------*/ |
94 | #define CSRMAX(a, b) (((a) > (b)) ? (a) : (b)) | ||
95 | #define CSRMIN(a, b) (((a) < (b)) ? (a) : (b)) | 34 | #define CSRMIN(a, b) (((a) < (b)) ? (a) : (b)) |
96 | 35 | ||
97 | /* Use this macro on unused local variables that cannot be removed (such as | 36 | /* Use this macro on unused local variables that cannot be removed (such as |
@@ -99,8 +38,4 @@ | |||
99 | and static code analysis tools like Lint and Valgrind. */ | 38 | and static code analysis tools like Lint and Valgrind. */ |
100 | #define CSR_UNUSED(x) ((void) (x)) | 39 | #define CSR_UNUSED(x) ((void) (x)) |
101 | 40 | ||
102 | #define CSR_TOUPPER(character) (((character) >= 'a') && ((character) <= 'z') ? ((character) - 0x20) : (character)) | ||
103 | #define CSR_TOLOWER(character) (((character) >= 'A') && ((character) <= 'Z') ? ((character) + 0x20) : (character)) | ||
104 | #define CSR_ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x))) | ||
105 | |||
106 | #endif | 41 | #endif |