From c369667e3be1de7c09aa714f98c45c092acc3548 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Tigeot?= Date: Wed, 23 May 2018 22:33:36 +0200 Subject: [PATCH] drm/linux/timer.h: No need to protect a callout struct from MP accesses MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Spotted-by: Imre Vadász --- sys/dev/drm/include/linux/timer.h | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/sys/dev/drm/include/linux/timer.h b/sys/dev/drm/include/linux/timer.h index 0122c1b4a4..64daaf9f63 100644 --- a/sys/dev/drm/include/linux/timer.h +++ b/sys/dev/drm/include/linux/timer.h @@ -1,8 +1,8 @@ -/*- +/* * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2014,2015 François Tigeot + * Copyright (c) 2014-2018 François Tigeot * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,21 +29,18 @@ #ifndef _LINUX_TIMER_H_ #define _LINUX_TIMER_H_ -#include +#include +#include +#include +#include -#include -#include #include -#include - -#include struct timer_list { struct callout timer_callout; void (*function)(unsigned long); unsigned long data; unsigned long expires; - struct lwkt_token timer_token; }; static inline void @@ -59,7 +56,6 @@ _timer_fn(void *context) do { \ (timer)->function = (func); \ (timer)->data = (dat); \ - lwkt_token_init(&(timer)->timer_token, "timer token"); \ callout_init_mp(&(timer)->timer_callout); \ } while (0) @@ -69,35 +65,26 @@ do { \ do { \ (timer)->function = NULL; \ (timer)->data = 0; \ - lwkt_token_init(&(timer)->timer_token, "timer token"); \ callout_init_mp(&(timer)->timer_callout); \ } while (0) #define mod_timer(timer, exp) \ do { \ (timer)->expires = (exp); \ - lwkt_gettoken(&(timer)->timer_token); \ callout_reset(&(timer)->timer_callout, (exp) - jiffies, \ _timer_fn, (timer)); \ - lwkt_reltoken(&(timer)->timer_token); \ } while (0) #define mod_timer_pinned(timer, exp) mod_timer(timer, exp) #define add_timer(timer) \ - lwkt_gettoken(&(timer)->timer_token); \ callout_reset(&(timer)->timer_callout, \ (timer)->expires - jiffies, _timer_fn, (timer)); \ - lwkt_reltoken(&(timer)->timer_token); static inline void del_timer(struct timer_list *timer) { - lwkt_gettoken(&(timer)->timer_token); callout_stop(&(timer)->timer_callout); - lwkt_reltoken(&(timer)->timer_token); - - lwkt_token_uninit(&(timer)->timer_token); } static inline int -- 2.11.4.GIT