Skip to contentSkip to conversation

aio: Fix compile error due to unexpected use of cmpxchg()

PATCH In review Guenter Roeck 2 participants 2 messages Jan 22, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aio: Fix compile error due to unexpected use of cmpxchg()

cmpxchg() on some architectures (ia64) doesn't like functions as parameters. This results in the following compile error on the affected architectures.

fs/aio.c: In function 'aio_thread_fn':
fs/aio.c:1499:1: error: cast specifies function type

Fixes 6a81013efc40 ("aio: add support for IOCB_CMD_POLL via aio thread helper")
Cc Benjamin LaHaise <[email protected]>

---
No idea if this is the correct or an acceptable fix. If not, please consider this to be a bug report.

 fs/aio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/aio.c +2 -2
index 56bcdf4105f4..229a91e391df 100644
@@ -1495,8 +1495,8 @@ static void aio_thread_fn(struct work_struct *work)
 	 * cancellation if it has not already occurred.
 	 */
 	old_cancel = cmpxchg(&iocb->ki_cancel,
-			     aio_thread_queue_iocb_cancel_early,
-			     aio_thread_queue_iocb_cancel);
+			     (kiocb_cancel_fn *)aio_thread_queue_iocb_cancel_early,
+			     (kiocb_cancel_fn *)aio_thread_queue_iocb_cancel);
 	if (old_cancel != KIOCB_CANCELLED)
 		ret = iocb->ki_work_fn(iocb);
 	else
Signature · 1 line
2.1.4
maintainer
#1 lore raw
Quoted 7 lines · Guenter Roeck

cmpxchg() on some architectures (ia64) doesn't like functions as parameters. This results in the following compile error on the affected architectures.

fs/aio.c: In function 'aio_thread_fn':
fs/aio.c:1499:1: error: cast specifies function type

Fixes 6a81013efc40 ("aio: add support for IOCB_CMD_POLL via aio thread helper")

Ah, I was wondering if there was an easy way to fix this bug. Applied -- thanks!

-ben

Quoted 26 lines
Cc Benjamin LaHaise <[email protected]>

---
No idea if this is the correct or an acceptable fix. If not, please consider this to be a bug report.

 fs/aio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/aio.c +2 -2
index 56bcdf4105f4..229a91e391df 100644
@@ -1495,8 +1495,8 @@ static void aio_thread_fn(struct work_struct *work)
 	 * cancellation if it has not already occurred.
 	 */
 	old_cancel = cmpxchg(&iocb->ki_cancel,
-			     aio_thread_queue_iocb_cancel_early,
-			     aio_thread_queue_iocb_cancel);
+			     (kiocb_cancel_fn *)aio_thread_queue_iocb_cancel_early,
+			     (kiocb_cancel_fn *)aio_thread_queue_iocb_cancel);
 	if (old_cancel != KIOCB_CANCELLED)
 		ret = iocb->ki_work_fn(iocb);
 	else
Signature · 1 line
2.1.4
Signature · 7 lines
"Thought is the essence of where you are now."

--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to [email protected].  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"[email protected]">[email protected]</a>