Return-Path: Received: from vms173023pub.verizon.net (vms173023pub.verizon.net [206.46.173.23]) by arago-project.org (Postfix) with ESMTP id 45D4452094 for ; Thu, 29 May 2014 01:39:45 +0000 (UTC) Received: from gandalf.denix.org ([unknown] [71.191.205.189]) by vms173023.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0N6B002VKB9NIC80@vms173023.mailsrvcs.net> for meta-arago@arago-project.org; Wed, 28 May 2014 20:39:29 -0500 (CDT) Received: from localhost.localdomain (elrond [192.168.0.7]) by gandalf.denix.org (Postfix) with ESMTP id 3E01C20086; Wed, 28 May 2014 21:39:23 -0400 (EDT) From: Denys Dmytriyenko To: meta-arago@arago-project.org Date: Wed, 28 May 2014 21:39:22 -0400 Message-id: <1401327562-3151-1-git-send-email-denis@denix.org> X-Mailer: git-send-email 1.9.3 Subject: [PATCH] cryptodev: fix INIT_COMPLETION macro change in kernels 3.13+ X-BeenThere: meta-arago@arago-project.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Arago metadata layer for TI SDKs - OE-Core/Yocto compatible List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 01:39:45 -0000 From: Denys Dmytriyenko Signed-off-by: Denys Dmytriyenko --- .../recipes-kernel/cryptodev/cryptodev_1.6.bb | 4 +- ...-rc1-Linux-kernel-the-INIT_COMPLETION-mac.patch | 86 ++++++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 meta-arago-extras/recipes-kernel/cryptodev/files/0002-In-the-3.13-rc1-Linux-kernel-the-INIT_COMPLETION-mac.patch diff --git a/meta-arago-extras/recipes-kernel/cryptodev/cryptodev_1.6.bb b/meta-arago-extras/recipes-kernel/cryptodev/cryptodev_1.6.bb index 637e59a..086259b 100644 --- a/meta-arago-extras/recipes-kernel/cryptodev/cryptodev_1.6.bb +++ b/meta-arago-extras/recipes-kernel/cryptodev/cryptodev_1.6.bb @@ -8,4 +8,6 @@ RREPLACES_${PN} = "ocf-linux" inherit module -PR = "r1" +PR = "r2" + +SRC_URI += "file://0002-In-the-3.13-rc1-Linux-kernel-the-INIT_COMPLETION-mac.patch" diff --git a/meta-arago-extras/recipes-kernel/cryptodev/files/0002-In-the-3.13-rc1-Linux-kernel-the-INIT_COMPLETION-mac.patch b/meta-arago-extras/recipes-kernel/cryptodev/files/0002-In-the-3.13-rc1-Linux-kernel-the-INIT_COMPLETION-mac.patch new file mode 100644 index 0000000..c5c7ec7 --- /dev/null +++ b/meta-arago-extras/recipes-kernel/cryptodev/files/0002-In-the-3.13-rc1-Linux-kernel-the-INIT_COMPLETION-mac.patch @@ -0,0 +1,86 @@ +From 57b5544de80db85c8955499831fdaa30829db77a Mon Sep 17 00:00:00 2001 +From: Cosmin Paraschiv +Date: Thu, 23 Jan 2014 03:40:00 +0100 +Subject: [PATCH] In the 3.13-rc1 Linux kernel, the INIT_COMPLETION macro has + been replaced with an inline function, reinit_completion [1][2]. We are + currently using the 3.13-rc3 Linux kernel, which leads to the following + error: + +cryptlib.c:279:2: error: implicit declaration of function 'INIT_COMPLETION' [-Werror=implicit-function-declaration] + INIT_COMPLETION(cdata->async.result->completion); + +[1] https://github.com/torvalds/linux/commit/c32f74ab2872994bc8336ed367313da3139350ca +[2] https://github.com/torvalds/linux/commit/62026aedaacedbe1ffe94a3599ad4acd8ecdf587 + +Signed-off-by: Cosmin Paraschiv +Reviewed-by: Cristian Stoica +Tested-by: Cristian Stoica +Signed-off-by: Horia Geanta +Signed-off-by: Phil Sutter + +Upstream-Status: Backport +--- + cryptlib.c | 8 ++++---- + cryptodev_int.h | 6 ++++++ + 2 files changed, 10 insertions(+), 4 deletions(-) + +diff --git a/cryptlib.c b/cryptlib.c +index 54d5d41..a923c14 100644 +--- a/cryptlib.c ++++ b/cryptlib.c +@@ -217,7 +217,7 @@ ssize_t cryptodev_cipher_encrypt(struct cipher_data *cdata, + { + int ret; + +- INIT_COMPLETION(cdata->async.result->completion); ++ reinit_completion(&cdata->async.result->completion); + + if (cdata->aead == 0) { + ablkcipher_request_set_crypt(cdata->async.request, +@@ -240,7 +240,7 @@ ssize_t cryptodev_cipher_decrypt(struct cipher_data *cdata, + { + int ret; + +- INIT_COMPLETION(cdata->async.result->completion); ++ reinit_completion(&cdata->async.result->completion); + if (cdata->aead == 0) { + ablkcipher_request_set_crypt(cdata->async.request, + (struct scatterlist *)src, dst, +@@ -351,7 +351,7 @@ ssize_t cryptodev_hash_update(struct hash_data *hdata, + { + int ret; + +- INIT_COMPLETION(hdata->async.result->completion); ++ reinit_completion(&hdata->async.result->completion); + ahash_request_set_crypt(hdata->async.request, sg, NULL, len); + + ret = crypto_ahash_update(hdata->async.request); +@@ -363,7 +363,7 @@ int cryptodev_hash_final(struct hash_data *hdata, void* output) + { + int ret; + +- INIT_COMPLETION(hdata->async.result->completion); ++ reinit_completion(&hdata->async.result->completion); + ahash_request_set_crypt(hdata->async.request, NULL, output, 0); + + ret = crypto_ahash_final(hdata->async.request); +diff --git a/cryptodev_int.h b/cryptodev_int.h +index 12dd5b1..188063d 100644 +--- a/cryptodev_int.h ++++ b/cryptodev_int.h +@@ -2,6 +2,12 @@ + #ifndef CRYPTODEV_INT_H + # define CRYPTODEV_INT_H + ++#include ++ ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)) ++# define reinit_completion(x) INIT_COMPLETION(*(x)) ++#endif ++ + #include + #include + #include +-- +1.9.1 + -- 1.9.3