From d0f4afe2ec99ab26dfeb2e66c244302dc5b03895 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 23 Jul 2018 04:21:32 +0000 Subject: [PATCH] scst/include/backport.h: Avoid that the timer_setup() backport triggers a warning Avoid that gcc 8 reports the following warning for the timer_setup() backport: warning: cast between incompatible function types from 'void (*)(struct timer_list *)' to 'void (*)(long unsigned int)' [-Wcast-function-type] (_timer)->function = (void (*)(unsigned long))(_fn); \ git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7433 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index f05a284c0..2fd1fe847 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -715,14 +715,14 @@ struct t10_pi_tuple { #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) #define timer_setup(_timer, _fn, _flags) do { \ init_timer(_timer); \ - (_timer)->function = (void (*)(unsigned long))(_fn); \ + (_timer)->function = (void *)(_fn); \ (_timer)->data = (unsigned long)(_timer); \ WARN_ON_ONCE((_flags) != 0); \ } while (0) #elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) #define timer_setup(_timer, _fn, _flags) do { \ init_timer(_timer); \ - (_timer)->function = (void (*)(unsigned long))(_fn); \ + (_timer)->function = (void *)(_fn);\ (_timer)->data = (unsigned long)(_timer); \ (_timer)->flags = (_flags); \ } while (0)