Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2460557yba; Mon, 15 Apr 2019 12:07:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOawgXPAXV8RwZq3+apaif2tbFG8ofE1YET87+g0kG2yrB7WIhUgMsG3bDFkw+udPyoa8g X-Received: by 2002:a17:902:9687:: with SMTP id n7mr36211244plp.105.1555355225427; Mon, 15 Apr 2019 12:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555355225; cv=none; d=google.com; s=arc-20160816; b=gDt035PrpZVuOdASlLdwNjLDD9+eWJ5iotFweg1HVBquX1GFfYHsQOghS+Pkpp0PGo 2o/uV564P4FsQZ5RTOS0eLT+ND9ur0SdHG8mu07zjARnsaGTieJOFHzTF74KfI13C+6w QX4q0hJLgdJc6OVnvBcuS21ZUTUHe214a4D7iS8XS9JCM8jMMEDI9AXlPPPkXkCyWiAD SGRwtYGUKiFpL2wCz7BEBjoyqFBDKgWt94h1oT2NdL8NW5lNFnORjjXuRJxavJpHNLD4 beh9aEheF+yuUt1Zh2QXUQM9Em6MHMpEXFzV7rFtAENOc6Wo6g4Dq9gJ6X1NpCtAAUPX 3o5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1hmJvCWTRe9qR666+nz2JhKZ8t0xLjQsce4ErcZz1Ug=; b=BFv46EBE2dSehE04cDKGevLcmIuDGRrVDLnRZHbTk8BjbAhqhQ3+E2+j9CWeeXKHUC D6v2bRqBOks39E71wmn+kNyIUkCQfwsbGOR/oC+5YKAehIN234HCvdSrcYTdizPumQzb y98kItSaYG5XvkD9797nQn2H31ZyR6F4RvJbP9A1CFFf6mwZF3wS249Oamsgm+GQjQXG gtbqq2JqFRGB9efpFqNAUIzf6rsXcOYkgZBjRR4zleHezVMm7V9eNRJpxc0Cy6ksSf83 HmMkUcqWKKvwLx/b2h3TAlDZgdM9a9cbfgTI/Ke2gT/U806TGoED5Hx4QXcFMSzFy6fk NNaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XDnvDFnB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r11si37808135pgp.337.2019.04.15.12.06.48; Mon, 15 Apr 2019 12:07:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XDnvDFnB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729509AbfDOTES (ORCPT + 99 others); Mon, 15 Apr 2019 15:04:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:37076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729491AbfDOTEQ (ORCPT ); Mon, 15 Apr 2019 15:04:16 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A25212087C; Mon, 15 Apr 2019 19:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555355056; bh=8rRQHwobng+aZa9UIy3jd+ANvm5R4fXjvQ7dzLT+bWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XDnvDFnBxiIfcA3lh2bvTga41TIaL8hma+bCZsKhuMMleg22pZR+pCuAxRtOUe4Ir l/VmyX+gVYwH892PGcegvERGcUgFUP4wz7wapGD5L1GdtNEXjhRI+osAO9F6d8HBFR oALjT176rQ2ft5Icu85YNCpzcGFHNew/QVLHnnFI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrei Vagin , Thomas Gleixner , Mukesh Ojha , Stephen Boyd , John Stultz Subject: [PATCH 4.14 42/69] alarmtimer: Return correct remaining time Date: Mon, 15 Apr 2019 20:59:00 +0200 Message-Id: <20190415183733.048867920@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183726.036654568@linuxfoundation.org> References: <20190415183726.036654568@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrei Vagin commit 07d7e12091f4ab869cc6a4bb276399057e73b0b3 upstream. To calculate a remaining time, it's required to subtract the current time from the expiration time. In alarm_timer_remaining() the arguments of ktime_sub are swapped. Fixes: d653d8457c76 ("alarmtimer: Implement remaining callback") Signed-off-by: Andrei Vagin Signed-off-by: Thomas Gleixner Reviewed-by: Mukesh Ojha Cc: Stephen Boyd Cc: John Stultz Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20190408041542.26338-1-avagin@gmail.com Signed-off-by: Greg Kroah-Hartman --- kernel/time/alarmtimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -597,7 +597,7 @@ static ktime_t alarm_timer_remaining(str { struct alarm *alarm = &timr->it.alarm.alarmtimer; - return ktime_sub(now, alarm->node.expires); + return ktime_sub(alarm->node.expires, now); } /**