From: Julien Grall Date: Tue, 1 Apr 2014 16:24:43 +0000 (+0200) Subject: crypto: rijndael: fix compilation with Clang 3.5 X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5306^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=836b363c55d4f3b2b9994a42d33cbbe09a024961;p=xen.git crypto: rijndael: fix compilation with Clang 3.5 Td0, Td1, Td2, Td3, Td4 are only used when NEED_RIJNDAEL is defined. rijndael.c:383:18: error: unused variable 'Td0' [-Werror,-Wunused-const-variable] static const u32 Td0[256] = { ^ rijndael.c:449:18: error: unused variable 'Td1' [-Werror,-Wunused-const-variable] static const u32 Td1[256] = { ^ rijndael.c:515:18: error: unused variable 'Td2' [-Werror,-Wunused-const-variable] static const u32 Td2[256] = { ^ rijndael.c:581:18: error: unused variable 'Td3' [-Werror,-Wunused-const-variable] static const u32 Td3[256] = { ^ rijndael.c:647:18: error: unused variable 'Td4' [-Werror,-Wunused-const-variable] static const u32 Td4[256] = { Signed-off-by: Julien Grall Acked-by: Keir Fraser --- diff --git a/xen/crypto/rijndael.c b/xen/crypto/rijndael.c index b7cd0d1acd..9de0992ce5 100644 --- a/xen/crypto/rijndael.c +++ b/xen/crypto/rijndael.c @@ -380,6 +380,8 @@ static const u32 Te4[256] = { 0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU, 0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U, }; + +#ifdef NEED_RIJNDAEL_DECRYPT static const u32 Td0[256] = { 0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U, 0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U, @@ -710,6 +712,7 @@ static const u32 Td4[256] = { 0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U, 0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU, }; +#endif static const u32 rcon[] = { 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000,