Commit 8f243af42adef5f589b8e39656284ca9c9374e44

Authored by Joe Mario
Committed by Linus Torvalds
1 parent c7fd5bc77e

sections: fix const sections for crc32 table

Fix the const sections for the code generated by crc32 table.  There's
no ro version of the cacheline aligned section, so we cannot put in
const data without a conflict Just don't make the crc tables const for
now.

[ak@linux.intel.com: some fixes and new description]
[akpm@linux-foundation.org: checkpatch fixes]
Signed-off-by: Joe Mario <jmario@redhat.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 2 changed files with 9 additions and 6 deletions Side-by-side Diff

... ... @@ -188,11 +188,13 @@
188 188 #else
189 189 u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len)
190 190 {
191   - return crc32_le_generic(crc, p, len, crc32table_le, CRCPOLY_LE);
  191 + return crc32_le_generic(crc, p, len,
  192 + (const u32 (*)[256])crc32table_le, CRCPOLY_LE);
192 193 }
193 194 u32 __pure __crc32c_le(u32 crc, unsigned char const *p, size_t len)
194 195 {
195   - return crc32_le_generic(crc, p, len, crc32ctable_le, CRC32C_POLY_LE);
  196 + return crc32_le_generic(crc, p, len,
  197 + (const u32 (*)[256])crc32ctable_le, CRC32C_POLY_LE);
196 198 }
197 199 #endif
198 200 EXPORT_SYMBOL(crc32_le);
... ... @@ -253,7 +255,8 @@
253 255 #else
254 256 u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len)
255 257 {
256   - return crc32_be_generic(crc, p, len, crc32table_be, CRCPOLY_BE);
  258 + return crc32_be_generic(crc, p, len,
  259 + (const u32 (*)[256])crc32table_be, CRCPOLY_BE);
257 260 }
258 261 #endif
259 262 EXPORT_SYMBOL(crc32_be);
lib/gen_crc32table.c
... ... @@ -109,7 +109,7 @@
109 109  
110 110 if (CRC_LE_BITS > 1) {
111 111 crc32init_le();
112   - printf("static const u32 __cacheline_aligned "
  112 + printf("static u32 __cacheline_aligned "
113 113 "crc32table_le[%d][%d] = {",
114 114 LE_TABLE_ROWS, LE_TABLE_SIZE);
115 115 output_table(crc32table_le, LE_TABLE_ROWS,
... ... @@ -119,7 +119,7 @@
119 119  
120 120 if (CRC_BE_BITS > 1) {
121 121 crc32init_be();
122   - printf("static const u32 __cacheline_aligned "
  122 + printf("static u32 __cacheline_aligned "
123 123 "crc32table_be[%d][%d] = {",
124 124 BE_TABLE_ROWS, BE_TABLE_SIZE);
125 125 output_table(crc32table_be, LE_TABLE_ROWS,
... ... @@ -128,7 +128,7 @@
128 128 }
129 129 if (CRC_LE_BITS > 1) {
130 130 crc32cinit_le();
131   - printf("static const u32 __cacheline_aligned "
  131 + printf("static u32 __cacheline_aligned "
132 132 "crc32ctable_le[%d][%d] = {",
133 133 LE_TABLE_ROWS, LE_TABLE_SIZE);
134 134 output_table(crc32ctable_le, LE_TABLE_ROWS,