Skip to content

Commit 2634303

Browse files
committed
alarmtimers: Remove return value from alarm functions
Now that the SIG_IGN problem is solved in the core code, the alarmtimer callbacks do not require a return value anymore. Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Frederic Weisbecker <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 6b0aa14 commit 2634303

File tree

5 files changed

+10
-27
lines changed

5 files changed

+10
-27
lines changed

drivers/power/supply/charger-manager.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,10 +1412,9 @@ static inline struct charger_desc *cm_get_drv_data(struct platform_device *pdev)
14121412
return dev_get_platdata(&pdev->dev);
14131413
}
14141414

1415-
static enum alarmtimer_restart cm_timer_func(struct alarm *alarm, ktime_t now)
1415+
static void cm_timer_func(struct alarm *alarm, ktime_t now)
14161416
{
14171417
cm_timer_set = false;
1418-
return ALARMTIMER_NORESTART;
14191418
}
14201419

14211420
static int charger_manager_probe(struct platform_device *pdev)

fs/timerfd.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,11 @@ static enum hrtimer_restart timerfd_tmrproc(struct hrtimer *htmr)
7979
return HRTIMER_NORESTART;
8080
}
8181

82-
static enum alarmtimer_restart timerfd_alarmproc(struct alarm *alarm,
83-
ktime_t now)
82+
static void timerfd_alarmproc(struct alarm *alarm, ktime_t now)
8483
{
8584
struct timerfd_ctx *ctx = container_of(alarm, struct timerfd_ctx,
8685
t.alarm);
8786
timerfd_triggered(ctx);
88-
return ALARMTIMER_NORESTART;
8987
}
9088

9189
/*

include/linux/alarmtimer.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ enum alarmtimer_type {
2020
ALARM_BOOTTIME_FREEZER,
2121
};
2222

23-
enum alarmtimer_restart {
24-
ALARMTIMER_NORESTART,
25-
ALARMTIMER_RESTART,
26-
};
27-
28-
2923
#define ALARMTIMER_STATE_INACTIVE 0x00
3024
#define ALARMTIMER_STATE_ENQUEUED 0x01
3125

@@ -42,14 +36,14 @@ enum alarmtimer_restart {
4236
struct alarm {
4337
struct timerqueue_node node;
4438
struct hrtimer timer;
45-
enum alarmtimer_restart (*function)(struct alarm *, ktime_t now);
39+
void (*function)(struct alarm *, ktime_t now);
4640
enum alarmtimer_type type;
4741
int state;
4842
void *data;
4943
};
5044

5145
void alarm_init(struct alarm *alarm, enum alarmtimer_type type,
52-
enum alarmtimer_restart (*function)(struct alarm *, ktime_t));
46+
void (*function)(struct alarm *, ktime_t));
5347
void alarm_start(struct alarm *alarm, ktime_t start);
5448
void alarm_start_relative(struct alarm *alarm, ktime_t start);
5549
void alarm_restart(struct alarm *alarm);

kernel/time/alarmtimer.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ static int alarmtimer_resume(struct device *dev)
321321

322322
static void
323323
__alarm_init(struct alarm *alarm, enum alarmtimer_type type,
324-
enum alarmtimer_restart (*function)(struct alarm *, ktime_t))
324+
void (*function)(struct alarm *, ktime_t))
325325
{
326326
timerqueue_init(&alarm->node);
327327
alarm->timer.function = alarmtimer_fired;
@@ -337,7 +337,7 @@ __alarm_init(struct alarm *alarm, enum alarmtimer_type type,
337337
* @function: callback that is run when the alarm fires
338338
*/
339339
void alarm_init(struct alarm *alarm, enum alarmtimer_type type,
340-
enum alarmtimer_restart (*function)(struct alarm *, ktime_t))
340+
void (*function)(struct alarm *, ktime_t))
341341
{
342342
hrtimer_init(&alarm->timer, alarm_bases[type].base_clockid,
343343
HRTIMER_MODE_ABS);
@@ -530,14 +530,12 @@ static enum alarmtimer_type clock2alarm(clockid_t clockid)
530530
*
531531
* Return: whether the timer is to be restarted
532532
*/
533-
static enum alarmtimer_restart alarm_handle_timer(struct alarm *alarm, ktime_t now)
533+
static void alarm_handle_timer(struct alarm *alarm, ktime_t now)
534534
{
535535
struct k_itimer *ptr = container_of(alarm, struct k_itimer, it.alarm.alarmtimer);
536536

537537
guard(spinlock_irqsave)(&ptr->it_lock);
538538
posix_timer_queue_signal(ptr);
539-
540-
return ALARMTIMER_NORESTART;
541539
}
542540

543541
/**
@@ -698,18 +696,14 @@ static int alarm_timer_create(struct k_itimer *new_timer)
698696
* @now: time at the timer expiration
699697
*
700698
* Wakes up the task that set the alarmtimer
701-
*
702-
* Return: ALARMTIMER_NORESTART
703699
*/
704-
static enum alarmtimer_restart alarmtimer_nsleep_wakeup(struct alarm *alarm,
705-
ktime_t now)
700+
static void alarmtimer_nsleep_wakeup(struct alarm *alarm, ktime_t now)
706701
{
707702
struct task_struct *task = alarm->data;
708703

709704
alarm->data = NULL;
710705
if (task)
711706
wake_up_process(task);
712-
return ALARMTIMER_NORESTART;
713707
}
714708

715709
/**
@@ -761,7 +755,7 @@ static int alarmtimer_do_nsleep(struct alarm *alarm, ktime_t absexp,
761755

762756
static void
763757
alarm_init_on_stack(struct alarm *alarm, enum alarmtimer_type type,
764-
enum alarmtimer_restart (*function)(struct alarm *, ktime_t))
758+
void (*function)(struct alarm *, ktime_t))
765759
{
766760
hrtimer_init_on_stack(&alarm->timer, alarm_bases[type].base_clockid,
767761
HRTIMER_MODE_ABS);

net/netfilter/xt_IDLETIMER.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,12 @@ static void idletimer_tg_expired(struct timer_list *t)
107107
schedule_work(&timer->work);
108108
}
109109

110-
static enum alarmtimer_restart idletimer_tg_alarmproc(struct alarm *alarm,
111-
ktime_t now)
110+
static void idletimer_tg_alarmproc(struct alarm *alarm, ktime_t now)
112111
{
113112
struct idletimer_tg *timer = alarm->data;
114113

115114
pr_debug("alarm %s expired\n", timer->attr.attr.name);
116115
schedule_work(&timer->work);
117-
return ALARMTIMER_NORESTART;
118116
}
119117

120118
static int idletimer_check_sysfs_name(const char *name, unsigned int size)

0 commit comments

Comments
 (0)