diff mbox

[3/3] crypto: sha3-generic - Use __optimize to support old compilers

Message ID 1517480520-4465-3-git-send-email-geert@linux-m68k.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Geert Uytterhoeven Feb. 1, 2018, 10:22 a.m. UTC
With gcc-4.1.2:

    crypto/sha3_generic.c:39: warning: ‘__optimize__’ attribute directive ignored

Use the newly introduced __optimize macro to fix this.

Fixes: 83dee2ce1ae791c3 ("crypto: sha3-generic - rewrite KECCAK transform to help the compiler optimize")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 crypto/sha3_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ard Biesheuvel Feb. 1, 2018, 5:30 p.m. UTC | #1
On 1 February 2018 at 10:22, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> With gcc-4.1.2:
>
>     crypto/sha3_generic.c:39: warning: ‘__optimize__’ attribute directive ignored
>
> Use the newly introduced __optimize macro to fix this.
>
> Fixes: 83dee2ce1ae791c3 ("crypto: sha3-generic - rewrite KECCAK transform to help the compiler optimize")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---
>  crypto/sha3_generic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/crypto/sha3_generic.c b/crypto/sha3_generic.c
> index a965b9d8055983af..c409cd87fea5decd 100644
> --- a/crypto/sha3_generic.c
> +++ b/crypto/sha3_generic.c
> @@ -35,7 +35,7 @@ static const u64 keccakf_rndc[24] = {
>
>  /* update the state with given number of rounds */
>
> -static void __attribute__((__optimize__("O3"))) keccakf(u64 st[25])
> +static void __optimize("O3") keccakf(u64 st[25])
>  {
>         u64 t[5], tt, bc[5];
>         int round;
> --
> 2.7.4
>
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/crypto/sha3_generic.c b/crypto/sha3_generic.c
index a965b9d8055983af..c409cd87fea5decd 100644
--- a/crypto/sha3_generic.c
+++ b/crypto/sha3_generic.c
@@ -35,7 +35,7 @@  static const u64 keccakf_rndc[24] = {
 
 /* update the state with given number of rounds */
 
-static void __attribute__((__optimize__("O3"))) keccakf(u64 st[25])
+static void __optimize("O3") keccakf(u64 st[25])
 {
 	u64 t[5], tt, bc[5];
 	int round;