aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/crc.c
diff options
context:
space:
mode:
authormarcin.slusarz@gmail.com <marcin.slusarz@gmail.com>2008-02-27 16:38:38 -0500
committerJan Kara <jack@suse.cz>2008-04-17 08:22:24 -0400
commitc8ed837d371c24b678182a30e9f0b1f61dee212c (patch)
treee55b2be4c2445f0f9eb957867a3914cfdd9d1378 /fs/udf/crc.c
parent34f953ddfd15da8feb5b8383c93c35dc57202b66 (diff)
udf: constify crc
- constify internal crc table - mark udf_crc "in" parameter as const Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/crc.c')
-rw-r--r--fs/udf/crc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/udf/crc.c b/fs/udf/crc.c
index b1661296e786..f178c63686e0 100644
--- a/fs/udf/crc.c
+++ b/fs/udf/crc.c
@@ -23,7 +23,7 @@
23 23
24#include "udfdecl.h" 24#include "udfdecl.h"
25 25
26static uint16_t crc_table[256] = { 26static const uint16_t crc_table[256] = {
27 0x0000U, 0x1021U, 0x2042U, 0x3063U, 0x4084U, 0x50a5U, 0x60c6U, 0x70e7U, 27 0x0000U, 0x1021U, 0x2042U, 0x3063U, 0x4084U, 0x50a5U, 0x60c6U, 0x70e7U,
28 0x8108U, 0x9129U, 0xa14aU, 0xb16bU, 0xc18cU, 0xd1adU, 0xe1ceU, 0xf1efU, 28 0x8108U, 0x9129U, 0xa14aU, 0xb16bU, 0xc18cU, 0xd1adU, 0xe1ceU, 0xf1efU,
29 0x1231U, 0x0210U, 0x3273U, 0x2252U, 0x52b5U, 0x4294U, 0x72f7U, 0x62d6U, 29 0x1231U, 0x0210U, 0x3273U, 0x2252U, 0x52b5U, 0x4294U, 0x72f7U, 0x62d6U,
@@ -79,7 +79,7 @@ static uint16_t crc_table[256] = {
79 * July 21, 1997 - Andrew E. Mileski 79 * July 21, 1997 - Andrew E. Mileski
80 * Adapted from OSTA-UDF(tm) 1.50 standard. 80 * Adapted from OSTA-UDF(tm) 1.50 standard.
81 */ 81 */
82uint16_t udf_crc(uint8_t *data, uint32_t size, uint16_t crc) 82uint16_t udf_crc(const uint8_t *data, uint32_t size, uint16_t crc)
83{ 83{
84 while (size--) 84 while (size--)
85 crc = crc_table[(crc >> 8 ^ *(data++)) & 0xffU] ^ (crc << 8); 85 crc = crc_table[(crc >> 8 ^ *(data++)) & 0xffU] ^ (crc << 8);