On Wed, Jan 15, 2014 at 06:21:30PM +0200, Horia Geantă wrote:
> On 1/15/2014 5:46 PM, Phil Sutter wrote:
> > Hi,
> >
> > On Wed, Jan 15, 2014 at 05:22:18PM +0200, Horia Geanta wrote:
> >> From: Cosmin Paraschiv <cosmin.parasc...@freescale.com>
> >>
> >> In the 3.12 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:220: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 <cosmin.parasc...@freescale.com>
> >> Reviewed-by: Cristian Stoica <cristian.sto...@freescale.com>
> >> Tested-by: Cristian Stoica <cristian.sto...@freescale.com>
> >> Signed-off-by: Horia Geanta <horia.gea...@freescale.com>
> >> ---
> >>   cryptlib.c | 8 ++++----
> >>   1 file changed, 4 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);
> >
> > Wouldn't it be better to conditionally define INIT_COMPLETION to
> > reinit_completion for newer kernels? Doesn't this break downwards
> > compatibility?
> 
> That's a good question.
> Before posting v2, I would like to find out what is the goal here - to 
> be compatible with kernel 2.6.x onwards or...?

To not break existing compatibility. I have no idea which is the
earliest version of Linux cryptodev-linux runs on, but the proposed
change smells like breaking cryptodev-linux for everything before 3.12,
no?

> I am sure this is not the first time changes in the kernel affect 
> out-of-tree modules.

Yes, that's why most of them are more and more cluttered with those #IF
checks over time. Probably one of the main reasons why (sane) people try
to get their kernel modules mainline sooner or later.

Greetings, Phil

_______________________________________________
Cryptodev-linux-devel mailing list
Cryptodev-linux-devel@gna.org
https://mail.gna.org/listinfo/cryptodev-linux-devel

Reply via email to