Message ID | 20240227230431.1837717-2-alexandre.belloni@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-84160-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3015392dyb; Tue, 27 Feb 2024 15:06:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXDB8soX8NFAvGloDvSIkSYoi9925onJRaHm/ltFP3e6kKIe4vESRF/fc6jWNXz8wBs8AnUGE9s8dHMF7hqGJTNlFuyCg== X-Google-Smtp-Source: AGHT+IHH/2WK/EQ0DTr1X/Z54hafbEB2Hf+ZD7R7+KwRwYbb4td9Je4GflQtHHwcRlRL9vYza/jM X-Received: by 2002:a05:6102:370d:b0:470:6517:3077 with SMTP id s13-20020a056102370d00b0047065173077mr11599802vst.2.1709075196480; Tue, 27 Feb 2024 15:06:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709075196; cv=pass; d=google.com; s=arc-20160816; b=EKtJxJoFT3q+0WBjtmY6+4IZMDFX9dqtWPwEglAibMWWWVTRvDJYPFXyTvLoc3t3gA yIzDtKsm6TGm3+Eu7rb4nii99Tq4sPZIspbPMYhDWEIKMskCi1WVQBnPCyes9LROT8QF fX14wEeMEv4FWCJC7j9blb1SjiPfFoJ2rigb+dTy6lCSD86rl/slg9Ysgoehw/qYf+jK o5kBIajY3aacF1ynl6YziUaTntPL/aCAD1ukyCviRtF6HgSazKJ2KDdSxzXm2UCsEE02 +UYnqbABVM6bgIZ5NAsODxUhfcSwLCT3AMsWAd6hgpbzVWZ50KB1Yf0NfArqVB+hpEK/ P9Mg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=xPWLS2vYXFua2bug0ohUqf0o99PQKgw61UA1Alu92Xs=; fh=v+fQpqqloRxheg66y6v5BEIIh4tqlWdyRuynNr5XQWo=; b=fuylDjbVLB38/k0F4Sp8ie2Q9jEOOQNJha/JRWPdfnoWpUYsurLXL7kzvyPFNNfCo1 vMt0gZAKUixKJXliUUaADBhb3a1s5ofvmeZAtuye5RZCWQI+2SNHKjUW8A50c6v3dx2g hWDatNSpT0rlJEeBc4ksCaEt+pA9Wzhqou1ZHWnI9ItWC4WcG9QApmwXNGgQNqw/jfEK Saj2rotipHOJNWxU2Oq+dZug8vqpTHe1IxKlmUx19d1FQpuSP9zEtJu0IIKNS4zKHTUy 7Lbe4BvlwnJ6lOpBoODLPVZIa6dYJj9BZ8RG8kS08NYYbC3wYjpQFkp9E+12SEiNenaj 5VzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=p00F9w65; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-84160-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84160-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p5-20020a056102200500b00470506facf2si1106475vsr.0.2024.02.27.15.06.36 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:06:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84160-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=p00F9w65; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-84160-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84160-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 8AE101C2449D for <ouuuleilei@gmail.com>; Tue, 27 Feb 2024 23:05:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4587A57305; Tue, 27 Feb 2024 23:04:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="p00F9w65" Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (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 F362E56741; Tue, 27 Feb 2024 23:04:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075089; cv=none; b=s/UYshg1frNxKE95T/cRmF4STDosGT/FGnXWJBVdOedTOd5QFsfEKmPv4Bpxs3VKLwZrIxO8H/fGn/ArdW0njhB9IdNzp8FjNe9vue292wAJlgSUyZENF7WfVd60x9sYTE6ETQ1Vo4wn+ApepPuxSofH0QsGVAGrOG75OTHJZKY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075089; c=relaxed/simple; bh=zo9Df9JHxN0K53/19URRHka3gUcLUDl/foFb5EGQk34=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b+wtMYxLFG9Bnx9Q0o/7B9bANq2Nb77irZbx8kBF1vxVWWPOegoNhbODWIBDotCfp7Z8qayJyiYlS5mrb1bntPtzIIFrJN+GRoSn0mvWqZYwmQFFcdmiUuRyJcYT05TK6j+xta+4/8GtKgPyMb31MTCikwYZJbaQU9IAyCm9JC0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=p00F9w65; arc=none smtp.client-ip=217.70.183.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id B2E2A60003; Tue, 27 Feb 2024 23:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709075084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xPWLS2vYXFua2bug0ohUqf0o99PQKgw61UA1Alu92Xs=; b=p00F9w65LHHP8MlKrCE93I07ZCFGBvO19baUFIUKaSdussHa1PfjLlBo/Jv8Qbx8LR5Vs5 HP0sK6QgYYQ90pzv5Pn0HcTMuoSqa6DRWOyAIqKCuOl75IGwtlM4YFyo6dCpI7HKPDq1d7 soTG0YS0nxKt685D+vmt/v+StMQn1ab4mg6SXyfUpqt9GMd1EM8cEHP4igle5RbvPQCudC 00l0hGRnSr0e++Goa4BZ+CoMc/D7sJAM1YBVlsghnNI9oaMoUGwgRWypHTWejFbFsThgBd bmoL1eLbNvmQYW2sMii7RyNrVW1mAZx5R9lT4g8sdAtZodQuCzWr0RZJSUi/Zg== From: alexandre.belloni@bootlin.com To: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/12] rtc: ds1511: drop useless computation Date: Wed, 28 Feb 2024 00:04:17 +0100 Message-ID: <20240227230431.1837717-2-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> References: <20240227230431.1837717-1-alexandre.belloni@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: alexandre.belloni@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792095233528783718 X-GMAIL-MSGID: 1792095233528783718 |
Series |
[01/12] rtc: ds1511: drop useless checks
|
|
Commit Message
Alexandre Belloni
Feb. 27, 2024, 11:04 p.m. UTC
From: Alexandre Belloni <alexandre.belloni@bootlin.com> All the callers of ds1511_rtc_set_time will use the same epoch for tm_year which is defined as the number of years minus 1900 since POSIX.1-2001. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> --- drivers/rtc/rtc-ds1511.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index 87c52d20d31a..a646bcf9cd56 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -166,24 +166,13 @@ ds1511_wdog_disable(void) } #endif -/* - * set the rtc chip's idea of the time. - * stupidly, some callers call with year unmolested; - * and some call with year = year - 1900. thanks. - */ static int ds1511_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm) { u8 mon, day, dow, hrs, min, sec, yrs, cen; unsigned long flags; - /* - * won't have to change this for a while - */ - if (rtc_tm->tm_year < 1900) - rtc_tm->tm_year += 1900; - yrs = rtc_tm->tm_year % 100; - cen = rtc_tm->tm_year / 100; + cen = 19 + rtc_tm->tm_year / 100; mon = rtc_tm->tm_mon + 1; /* tm_mon starts at zero */ day = rtc_tm->tm_mday; dow = rtc_tm->tm_wday & 0x7; /* automatic BCD */