Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp95513rdh; Wed, 22 Nov 2023 20:10:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEDs/Q6zewPw7R8161cmPbzj+Io726pHGagRn71rRJ3SS8tmvQA/HSRUUN3ApiEvQBxdFl7 X-Received: by 2002:a17:90a:bf0b:b0:280:47ba:767a with SMTP id c11-20020a17090abf0b00b0028047ba767amr2187414pjs.16.1700712613893; Wed, 22 Nov 2023 20:10:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700712613; cv=none; d=google.com; s=arc-20160816; b=YMmSX9xNgVJlOcEcYWzfIRXiuRiDFHsBwc36H43IMHQbNVKU2miLhmSM0pa5wwOvYz AUGN+MSYzAJYjtBCNo+bRU+pp64mE51hfZdEtWz9fFExz49geE39Yy6t+FhOmIsmoK1h Gw56OioSU7zRr3s/Cr+KlvcuXz60IwKbVad9gYLY33F9RsFqlNupFb+80TwpHia4p9l9 G0a/7IJmKFRujzwwGGWnmZiVGt+qz3OhnmDlHA527dLqVSPSGIlJMvFDR5OyLs1qBS6d 61JshUzll6qlduBxWPh/loXIayHMH9iYlzuE+CO7w/raAQjbkipwOlpAwURSsngGgp2k fPcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=cnAYolYzVC6+Ox+rXpGD2+5czZDHCkLmG8m5K79PKxU=; fh=KrVA2yb5Ze+xUoD1xSLigBsaosZXPVa7Y1HemksLM/k=; b=MZvcsaX2YpI82PwyamtF2vWz/wMYb3n24SYXSPPjXXZBQHxcpGsNoGkHl6gV0kZhhY HGlzLv8Z3t57GPB1iTgKabxi+y9vODO/sy/50a8FsKGUBp7xKA8hW1snu8yu2a66hQat CiqfQRcc3y0xNQAbtHiSiiFgLNx4Rz6mkbjXtCZP87Ji3gC8ET0u2+qXnAKEPcKmc3EP qjRIQk9rBYNF5vS/qJJyWSwjzC+giQpXMUNqO57UrKPczDYhW8CXkHxtDPKEM+qMCv9P WQJl1n/iQfT0S6V3nVsLuEWUlZEd5yFWS5yesWdxKyTlrSiPGh9TDVuXln36ccvEvYoL yDnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PqAV0JPC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id j2-20020a170902da8200b001c77674ea97si340609plx.423.2023.11.22.20.10.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 20:10:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PqAV0JPC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id BE195807CB44; Wed, 22 Nov 2023 20:10:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229481AbjKWEJs (ORCPT + 99 others); Wed, 22 Nov 2023 23:09:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234509AbjKWEJa (ORCPT ); Wed, 22 Nov 2023 23:09:30 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BE0A10E2 for ; Wed, 22 Nov 2023 20:08:47 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1cf52e5e07eso11467525ad.0 for ; Wed, 22 Nov 2023 20:08:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700712526; x=1701317326; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=cnAYolYzVC6+Ox+rXpGD2+5czZDHCkLmG8m5K79PKxU=; b=PqAV0JPC5IJUeXEhqdUV3fWyhJ+nB73TgV5nKHv2UMY6FCh+p0ct6/eeEX3chWDIR9 9ha44sUPsvtfshevRhQMNVGxNXmiHODQbQjTM5gWriDG9UMJGYZ/0IKEYO3a7yydqQk5 Oqqkf3yYYRw9V4ZXnhFOb/SqAHq9yaGR234aLeWIq8WRVPjVBiBo693TNBYQpIFilbvN NuLpbYr9sbprwS49MLmi3O2/70CapjsPrZATJCI8FTQreTuEg46aA+VwWmmXDtT7TGtH xgXY1l1R81bVadg9agqz/AYshObEQIZjiO31PKYBEGHAAOQCToBKhacKuZPWxAfMaMq2 yEDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700712526; x=1701317326; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cnAYolYzVC6+Ox+rXpGD2+5czZDHCkLmG8m5K79PKxU=; b=oZeJafwlGuy8VRKqD3AgCWo0JvwEAvwNB/Ryg/voQ+WCAINGAIdMXEguwV0E/MRPty V12ijtUEYSeLbhp6on5MAqmOhyu5x35oPglXhdj61+6OrcTpO1vPie25EfV8lryk5ciH FNUyva6H+UOe3qgtoCay7gJ7RdxNRsVU2jZatWQdPsuHgQpHI+zk5xNZ1jhZ1bt//8nO 2InDJeIjTnYq/aWc5Uf+9Ecpcd9qYJtDpeVjMyEkGcbutdMrOoQ+Fg+QCb0uG3wouqpu HgX+WbBLkDGybKJsLzjSmvux6MwJS2ZimfD2a7sh2gkBxu906CP8O1eWF0Y6sfmDzdqG 0gjA== X-Gm-Message-State: AOJu0YxbO8YmfYPIJoRfsncr+hFfbq8aLaLg6MGvTdrCdrbRIVFAuFuf /dPmlP7Bdg+V85srWGxGo6vqreczr2hpTQ== X-Received: by 2002:a17:902:74c8:b0:1cc:419e:cb4b with SMTP id f8-20020a17090274c800b001cc419ecb4bmr2314951plt.19.1700712525945; Wed, 22 Nov 2023 20:08:45 -0800 (PST) Received: from AHUANG12-3ZHH9X.lenovo.com (220-143-202-94.dynamic-ip.hinet.net. [220.143.202.94]) by smtp.gmail.com with ESMTPSA id w5-20020a170902904500b001cf85115f3asm213264plz.235.2023.11.22.20.08.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 20:08:45 -0800 (PST) From: Adrian Huang To: linux-kernel@vger.kernel.org Cc: John Stultz , Thomas Gleixner , Stephen Boyd , Adrian Huang , Adrian Huang Subject: [PATCH 1/1] ntp: Refine ntp_get_next_leap implementation Date: Thu, 23 Nov 2023 12:08:18 +0800 Message-Id: <20231123040818.24905-1-adrianhuang0701@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 22 Nov 2023 20:10:11 -0800 (PST) From: Adrian Huang It is unnecessary to use the local variable 'ret' in the ntp_get_next_leap implementation function - just return KTIME_MAX directly and get rid of the local variable altogether. Signed-off-by: Adrian Huang --- kernel/time/ntp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index 406dccb79c2b..af1a7e0c0f9d 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c @@ -379,12 +379,10 @@ u64 ntp_tick_length(void) */ ktime_t ntp_get_next_leap(void) { - ktime_t ret; - if ((time_state == TIME_INS) && (time_status & STA_INS)) return ktime_set(ntp_next_leap_sec, 0); - ret = KTIME_MAX; - return ret; + + return KTIME_MAX; } /* -- 2.25.1