Skip to content

Commit

Permalink
fix: fix ki_complete API change
Browse files Browse the repository at this point in the history
The patch series at
https://lore.kernel.org/all/ce839d66-1d05-dab8-4540-71b8485fdaf3@kernel.dk/
introduced an API change for ki_complete that has been since merged in
Linux v5.16.0. This change removes the second (unused) return argument
and only uses the first one

Signed-off-by: Tianrui Wei <tianrui@tianruiwei.com>
  • Loading branch information
tianrui-wei committed Jan 20, 2022
1 parent 81af929 commit bc9207f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion QDMA/linux-kernel/driver/src/cdev.c
Expand Up @@ -133,7 +133,9 @@ static int qdma_req_completed(struct qdma_request *req,
if (caio->cmpl_count == caio->req_count) {
res = caio->cmpl_count - caio->err_cnt;
res2 = caio->res2;
#if KERNEL_VERSION(4, 1, 0) <= LINUX_VERSION_CODE
#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE
caio->iocb->ki_complete(caio->iocb, res);
#elif KERNEL_VERSION(4, 1, 0) <= LINUX_VERSION_CODE
caio->iocb->ki_complete(caio->iocb, res, res2);
#else
aio_complete(caio->iocb, res, res2);
Expand Down
8 changes: 6 additions & 2 deletions XDMA/linux-kernel/xdma/cdev_sgdma.c
Expand Up @@ -104,7 +104,9 @@ static void async_io_handler(unsigned long cb_hndl, int err)
if (caio->cmpl_cnt == caio->req_cnt) {
res = caio->res;
res2 = caio->res2;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
caio->iocb->ki_complete(caio->iocb, res);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)
caio->iocb->ki_complete(caio->iocb, res, res2);
#else
aio_complete(caio->iocb, res, res2);
Expand All @@ -119,7 +121,9 @@ static void async_io_handler(unsigned long cb_hndl, int err)
return;

skip_dev_lock:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
caio->iocb->ki_complete(caio->iocb, res);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)
caio->iocb->ki_complete(caio->iocb, numbytes, -EBUSY);
#else
aio_complete(caio->iocb, numbytes, -EBUSY);
Expand Down

0 comments on commit bc9207f

Please sign in to comment.