Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4569615ybe; Mon, 16 Sep 2019 14:38:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkv0Wnl2YIsC48uWBgh+9p3YME46Lp28IxzEcaDjfvRDKNlHe4bm+rfeLFvcNDQJKExdXd X-Received: by 2002:a05:6402:2045:: with SMTP id bc5mr1463464edb.248.1568669932209; Mon, 16 Sep 2019 14:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568669932; cv=none; d=google.com; s=arc-20160816; b=1BpJShf6yOdszYOvnq7W8ffFMFu3QU2oKJmG9/f13oyPNuE5O72dvPIHsT8HpdXSt7 G7RD4v3yKFU7sRHzQd7J+glupjY9BqnNLpE9h6XXtQPXFT8P1bBJIPwIRqcqo4Bd93qI 7aXIx8RveR72aS8uMh/uqJayaAisCVdmf0v4/08Z3a8uz7NGQtw545GnHuIEOyGUTLYj ada5g70Cyf5CJR7+xrKXaVrmvt+fcCPpZE+qTb5HnEm1YU3r23VoizuOA4UGxZ73GXNp k3abRIqHUcZQyfreRbZo3vaLuOAsB6SvmsHhfXFui8cyEf8FLrBq0bLR7XvLwYsPLcGe YvvQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=N+PGY/OYnqAAb1/FHqUnx7n0Mo3lWfpgw5A8ZrHtWr4=; b=ic1JxUTD/G0D+/Kccv9sJSwPc6VZQB0f6m+gjHHFfZq2B+PoQuUsYY4vq3fOob6IzG BLHcyH+9qinCV16c0vSsv/0B3nYIAVuy/TYpQAmEHFS13hNa1eMyivdw06ymudPGjwGK 7egdhjhnvKKC3RcgYPAQVtc2GchWbS25e+LebyPdvycU7cY0ZH3aAbbpmj+bvTbGHzsR QWq47qselXXVjIhhB5u6AzEuKMohRzXpNN7YzRGngVKS46+p+gwJ1+TMn3Kn8CKy5FvG H8QLja0+287BWep1p0h1lgvcQqDObx6+jM9vt1RS8x59UTn6oUnZhSEZiK4TcTftXfk6 WZ+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nmAL6ZHF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mh25si95202ejb.81.2019.09.16.14.38.28; Mon, 16 Sep 2019 14:38:52 -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=@chromium.org header.s=google header.b=nmAL6ZHF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729815AbfIPSMs (ORCPT + 99 others); Mon, 16 Sep 2019 14:12:48 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:39031 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729750AbfIPSMs (ORCPT ); Mon, 16 Sep 2019 14:12:48 -0400 Received: by mail-io1-f66.google.com with SMTP id a1so1238611ioc.6 for ; Mon, 16 Sep 2019 11:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=N+PGY/OYnqAAb1/FHqUnx7n0Mo3lWfpgw5A8ZrHtWr4=; b=nmAL6ZHFAGaEG+Ah6SB9aapmquoRG60kXOcXblBjrlnFg0WHJWsswPgndye8cwHWGD 6xi6NFHjRPyMUkJ7Dsm0S8fx1h3MT8sP0Ik4Ja3vATA6JxDojlnNSUFp7k1HBDREZdvN 2LaKaZb9kLcXlfukzQpwUYxvWar/qBQ3azbSw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=N+PGY/OYnqAAb1/FHqUnx7n0Mo3lWfpgw5A8ZrHtWr4=; b=mlnUqGglJnioS1+imzYjUQ2d26rlZLokBK2DkDGHwTSkm0v1CM/WDgj8sjhrvHDUr2 CJDBEQn2jQezC7JSa0/hdFKTRRgDEOrUCRoP2Rn/FTE8ddpvGfW7A90+m2YaQ/CxjrQX Mkjuo00S4pPOCQ3/yTjb9hfX0fFr8lUgZ868cK5TRZiAGZG+DB0mZNTN2OWesHn0QAHc U/0LJ/iZggFlU+jmVbKtEuSWZtBHBUM4F1jOLL1PBDWtB3PgF9HJZwKN5/Ci9OIVwu97 pdwuhjneQlpL7Yh38xGrIC5sNK4gVgsTzk/XfyAurA6gyNJwzB4sEOzz2SmHr4am9AgP w7dg== X-Gm-Message-State: APjAAAVt5Yh8KcGEudgMEqefhgnVsGMBbDhLAcJjWu1gSV0Prrrv7NgN igT0722RJ16t8jeufyuDpIBi2w== X-Received: by 2002:a02:80d:: with SMTP id 13mr1383668jac.50.1568657567299; Mon, 16 Sep 2019 11:12:47 -0700 (PDT) Received: from ncrews2.bld.corp.google.com ([2620:15c:183:200:cb43:2cd4:65f5:5c84]) by smtp.gmail.com with ESMTPSA id t9sm10889188iop.86.2019.09.16.11.12.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Sep 2019 11:12:46 -0700 (PDT) From: Nick Crews To: bleung@chromium.org, Alexandre Belloni , Alessandro Zummo Cc: enric.balletbo@collabora.com, linux-kernel@vger.kernel.org, dlaurie@chromium.org, Nick Crews Subject: [PATCH v2 1/2] rtc: wilco-ec: Remove yday and wday calculations Date: Mon, 16 Sep 2019 12:12:15 -0600 Message-Id: <20190916181215.501-1-ncrews@chromium.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The tm_yday and tm_wday fields are not used by userspace, so since they aren't needed within the driver, don't bother calculating them. This is especially needed since the rtc_year_days() call was crashing if the HW returned an invalid time. Signed-off-by: Nick Crews --- drivers/rtc/rtc-wilco-ec.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/rtc/rtc-wilco-ec.c b/drivers/rtc/rtc-wilco-ec.c index 8ad4c4e6d557..e84faa268caf 100644 --- a/drivers/rtc/rtc-wilco-ec.c +++ b/drivers/rtc/rtc-wilco-ec.c @@ -110,10 +110,6 @@ static int wilco_ec_rtc_read(struct device *dev, struct rtc_time *tm) tm->tm_mday = rtc.day; tm->tm_mon = rtc.month - 1; tm->tm_year = rtc.year + (rtc.century * 100) - 1900; - tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year); - - /* Don't compute day of week, we don't need it. */ - tm->tm_wday = -1; return 0; } -- 2.21.0