Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp489065lqp; Mon, 10 Jun 2024 09:54:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWH59U6i7piNm/1Tvc6sj5tPaKZeTrcNeIWAQGRORW/z/lXKCgHZNRr1KyayEQbgHZaNlgsv1XIjiitVG9rjsdIdM3Xmtlf6rXVRDMrfg== X-Google-Smtp-Source: AGHT+IFPQmlTlaCRyPqXpQ4YLH5tejglOjSTnU4UCgkGtdkRmQ+aLjg6hi1xPtRHlNb4z/rdWh3q X-Received: by 2002:a05:6870:658e:b0:254:9ec6:c8cc with SMTP id 586e51a60fabf-2549ec6df1emr7017071fac.48.1718038488158; Mon, 10 Jun 2024 09:54:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718038488; cv=pass; d=google.com; s=arc-20160816; b=bPT+AGMCMVijjMvbsliU167CoqhkMMQc4ZSX79lgm+EtIF4CDxJLX2y/c9CYIsc9kA /LT2O4M8h9ngjD+pTGIPxnyq62Dsc73o2s9HgW7SSBtkcu39LniPRCWHnDcXK+tx0SdM AzZ9ztvFhVFEm7Y20CthR0oRlKO1MopK861saQejn9DfSmKrQ84EBFTkIGxfmmYxmnIV VIQ+CjL9njTexV0ul997aQAzYTKb7vnpGEBLh057tOM0ou+Z8K6J6HJeb7nM4PLe15Vw f7Cc+cxwnLqC4RAH/cXYTCMHI23816Wt1TXsW7kZL+pirzcQ9JGuNMxS1ta2p88pqwGL m23A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:subject:cc:to:from:dkim-signature :dkim-signature:message-id; bh=a/VQUBOvvL1gBabTFPPMD8zLuxnFJjH7wVLI37j0UKo=; fh=joBs/8L+orz77ylyCy6wqNwwi35f7sYhLR+/TQjQjhI=; b=XpfTqk7RBiQ3DkelUMNrBA9nOW9GRRU0ZhH6T1TiG28VlLIu6D07/YxSAjAMdormwN 6kXw2s0f9oMmLqAdIS+Q0qdKGvU0NLzEJgebPT3cb3tu3KjUD4qz2qpVgDBYxzunkos1 SEdmORHXimq/E08jIp3e5eJ9CSgHCFsoFHdlw1P0xfBohEQOYa1dqdcBt8+3xXL7FPHi vQtHPBXlpwBcgwfY3lVHVx3tVnDcFfLzYaVFsPhnioGGeF6jUuqoXeZFrhQ2R+YUhwQT H1Id3E0jDCtFeJjQxIwQ6VawCBnbSTuo7Q6sx4o3sFTpk0D/jbGyQbDoGnIhrpM7eahd 6o2Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZEiyNnJz; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-208620-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208620-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-7955d5937ecsi449657785a.95.2024.06.10.09.54.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 09:54:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208620-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZEiyNnJz; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-208620-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208620-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C6CE11C2191D for ; Mon, 10 Jun 2024 16:54:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D04EA14D70E; Mon, 10 Jun 2024 16:43:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZEiyNnJz"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="OOZH/UvE" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7E6E15991E for ; Mon, 10 Jun 2024 16:43:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718037792; cv=none; b=kDo7KL3EpX8DgnE0yxVFXfCVuuWz/qCsQH/rnQIzbvqr0o6rx6VZwvcVJ1CLiSOf6fQ4iTHf8paDHVsMUD+SziSOPWzF18o0m7IBwGKcPRdsbyG5gGxUS6RbKdplTybqhFXsw7e3AjAKDgs2c4Xy7UhgBltEs0Dpw8kpuZtderg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718037792; c=relaxed/simple; bh=VFiMQKyOoL+mDJlBq/h+g4Nftt1Jj5QgaCKxsBJg4zs=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=SR0KGLd0jrEG0wgTI2auK/0ATXdgF964fgZ7UEnIeEph4Ix8SEVEsDXUwLzCW1eC0LN+mLzR30NuZT0bx9awURWmpitSplPiIYCItSL2FcQaBvfzKXQIDwfy43Xk+iIniaNnkzTrNvdKMUr26voeVrIycrBQhJ9nxNFQ5DqR0QE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ZEiyNnJz; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=OOZH/UvE; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Message-ID: <20240610164028.660846109@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718037788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=a/VQUBOvvL1gBabTFPPMD8zLuxnFJjH7wVLI37j0UKo=; b=ZEiyNnJzuiMIy/h3VszLZ1/kiv1GEpz5vJy1eZCFM9cm29X7Hj0BGVlnUSpe4SxX9tXAWf xjp8aiOCIpUeduJn4hBegdnDfLehRFirwv/mKv94jmkGV+yZY6oBw0dbfBw6gokGWNZxBh qgAK1jyg7QFxcNHpJyoOuY0L1pIHwQCuHjnHT+sGyrSM5UNZmC+cV8qw8JwczudNSn63Vc nBWAm4UQIceYSS2hOIN1w2f7Sm9nRHLTsP1FkzzNthoZmu5lVRyKZsL7NQXHRki1WBvBWl +747MpLOvsSKjeVGDz4ZZ5TIRcJixANxOm4WOYOPay05FhMEldApp6c9+PpCiA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718037788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=a/VQUBOvvL1gBabTFPPMD8zLuxnFJjH7wVLI37j0UKo=; b=OOZH/UvEgMW34Kgb8IwP5qDL4JTMUVGFIBUzTWVdo0Ju5M6rklqLUaDfzdigjkDHdg3h3Q Oaay2W1nvpi/pGCQ== From: Thomas Gleixner To: LKML Cc: Anna-Maria Behnsen , Frederic Weisbecker , John Stultz , Peter Zijlstra , Ingo Molnar , Stephen Boyd , Eric Biederman , Oleg Nesterov Subject: [patch V3 51/51] alarmtimers: Remove return value from alarm functions References: <20240610163452.591699700@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Mon, 10 Jun 2024 18:43:08 +0200 (CEST) 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 --- drivers/power/supply/charger-manager.c | 3 +-- fs/timerfd.c | 4 +--- include/linux/alarmtimer.h | 10 ++-------- kernel/time/alarmtimer.c | 16 +++++----------- net/netfilter/xt_IDLETIMER.c | 4 +--- 5 files changed, 10 insertions(+), 27 deletions(-) --- a/drivers/power/supply/charger-manager.c +++ b/drivers/power/supply/charger-manager.c @@ -1412,10 +1412,9 @@ static inline struct charger_desc *cm_ge return dev_get_platdata(&pdev->dev); } -static enum alarmtimer_restart cm_timer_func(struct alarm *alarm, ktime_t now) +static void cm_timer_func(struct alarm *alarm, ktime_t now) { cm_timer_set = false; - return ALARMTIMER_NORESTART; } static int charger_manager_probe(struct platform_device *pdev) --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -79,13 +79,11 @@ static enum hrtimer_restart timerfd_tmrp return HRTIMER_NORESTART; } -static enum alarmtimer_restart timerfd_alarmproc(struct alarm *alarm, - ktime_t now) +static void timerfd_alarmproc(struct alarm *alarm, ktime_t now) { struct timerfd_ctx *ctx = container_of(alarm, struct timerfd_ctx, t.alarm); timerfd_triggered(ctx); - return ALARMTIMER_NORESTART; } /* --- a/include/linux/alarmtimer.h +++ b/include/linux/alarmtimer.h @@ -20,12 +20,6 @@ enum alarmtimer_type { ALARM_BOOTTIME_FREEZER, }; -enum alarmtimer_restart { - ALARMTIMER_NORESTART, - ALARMTIMER_RESTART, -}; - - #define ALARMTIMER_STATE_INACTIVE 0x00 #define ALARMTIMER_STATE_ENQUEUED 0x01 @@ -42,14 +36,14 @@ enum alarmtimer_restart { struct alarm { struct timerqueue_node node; struct hrtimer timer; - enum alarmtimer_restart (*function)(struct alarm *, ktime_t now); + void (*function)(struct alarm *, ktime_t now); enum alarmtimer_type type; int state; void *data; }; void alarm_init(struct alarm *alarm, enum alarmtimer_type type, - enum alarmtimer_restart (*function)(struct alarm *, ktime_t)); + void (*function)(struct alarm *, ktime_t)); void alarm_start(struct alarm *alarm, ktime_t start); void alarm_start_relative(struct alarm *alarm, ktime_t start); void alarm_restart(struct alarm *alarm); --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -323,7 +323,7 @@ static int alarmtimer_resume(struct devi static void __alarm_init(struct alarm *alarm, enum alarmtimer_type type, - enum alarmtimer_restart (*function)(struct alarm *, ktime_t)) + void (*function)(struct alarm *, ktime_t)) { timerqueue_init(&alarm->node); alarm->timer.function = alarmtimer_fired; @@ -339,7 +339,7 @@ static void * @function: callback that is run when the alarm fires */ void alarm_init(struct alarm *alarm, enum alarmtimer_type type, - enum alarmtimer_restart (*function)(struct alarm *, ktime_t)) + void (*function)(struct alarm *, ktime_t)) { hrtimer_init(&alarm->timer, alarm_bases[type].base_clockid, HRTIMER_MODE_ABS); @@ -532,7 +532,7 @@ static enum alarmtimer_type clock2alarm( * * Return: whether the timer is to be restarted */ -static enum alarmtimer_restart alarm_handle_timer(struct alarm *alarm, ktime_t now) +static void alarm_handle_timer(struct alarm *alarm, ktime_t now) { struct k_itimer *ptr = container_of(alarm, struct k_itimer, it.alarm.alarmtimer); unsigned long flags; @@ -540,8 +540,6 @@ static enum alarmtimer_restart alarm_han spin_lock_irqsave(&ptr->it_lock, flags); posix_timer_queue_signal(ptr); spin_unlock_irqrestore(&ptr->it_lock, flags); - - return ALARMTIMER_NORESTART; } /** @@ -702,18 +700,14 @@ static int alarm_timer_create(struct k_i * @now: time at the timer expiration * * Wakes up the task that set the alarmtimer - * - * Return: ALARMTIMER_NORESTART */ -static enum alarmtimer_restart alarmtimer_nsleep_wakeup(struct alarm *alarm, - ktime_t now) +static void alarmtimer_nsleep_wakeup(struct alarm *alarm, ktime_t now) { struct task_struct *task = alarm->data; alarm->data = NULL; if (task) wake_up_process(task); - return ALARMTIMER_NORESTART; } /** @@ -765,7 +759,7 @@ static int alarmtimer_do_nsleep(struct a static void alarm_init_on_stack(struct alarm *alarm, enum alarmtimer_type type, - enum alarmtimer_restart (*function)(struct alarm *, ktime_t)) + void (*function)(struct alarm *, ktime_t)) { hrtimer_init_on_stack(&alarm->timer, alarm_bases[type].base_clockid, HRTIMER_MODE_ABS); --- a/net/netfilter/xt_IDLETIMER.c +++ b/net/netfilter/xt_IDLETIMER.c @@ -107,14 +107,12 @@ static void idletimer_tg_expired(struct schedule_work(&timer->work); } -static enum alarmtimer_restart idletimer_tg_alarmproc(struct alarm *alarm, - ktime_t now) +static void idletimer_tg_alarmproc(struct alarm *alarm, ktime_t now) { struct idletimer_tg *timer = alarm->data; pr_debug("alarm %s expired\n", timer->attr.attr.name); schedule_work(&timer->work); - return ALARMTIMER_NORESTART; } static int idletimer_check_sysfs_name(const char *name, unsigned int size)