linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] aio: Fix compile error due to unexpected use of cmpxchg()
@ 2016-01-22 18:14 Guenter Roeck
  2016-01-22 18:44 ` Benjamin LaHaise
  0 siblings, 1 reply; 2+ messages in thread
From: Guenter Roeck @ 2016-01-22 18:14 UTC (permalink / raw)
  To: Alexander Viro
  Cc: linux-fsdevel, linux-aio, linux-kernel, kernel-testers,
	Guenter Roeck, Benjamin LaHaise

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 <bcrl@kvack.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
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(-)

diff --git a/fs/aio.c b/fs/aio.c
index 56bcdf4105f4..229a91e391df 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -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
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] aio: Fix compile error due to unexpected use of cmpxchg()
  2016-01-22 18:14 [PATCH -next] aio: Fix compile error due to unexpected use of cmpxchg() Guenter Roeck
@ 2016-01-22 18:44 ` Benjamin LaHaise
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin LaHaise @ 2016-01-22 18:44 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Alexander Viro, linux-fsdevel, linux-aio, linux-kernel,
	kernel-testers

On Fri, Jan 22, 2016 at 10:14:39AM -0800, Guenter Roeck wrote:
> 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

> Cc: Benjamin LaHaise <bcrl@kvack.org>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> 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(-)
> 
> diff --git a/fs/aio.c b/fs/aio.c
> index 56bcdf4105f4..229a91e391df 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -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
> -- 
> 2.1.4

-- 
"Thought is the essence of where you are now."

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-22 18:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-22 18:14 [PATCH -next] aio: Fix compile error due to unexpected use of cmpxchg() Guenter Roeck
2016-01-22 18:44 ` Benjamin LaHaise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).