From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6ABDECE587 for ; Mon, 14 Oct 2019 15:50:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ABBC42133F for ; Mon, 14 Oct 2019 15:50:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730275AbfJNPuZ (ORCPT ); Mon, 14 Oct 2019 11:50:25 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:37739 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730000AbfJNPuY (ORCPT ); Mon, 14 Oct 2019 11:50:24 -0400 X-Originating-IP: 86.207.98.53 Received: from localhost (aclermont-ferrand-651-1-259-53.w86-207.abo.wanadoo.fr [86.207.98.53]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 20BBD240018; Mon, 14 Oct 2019 15:50:22 +0000 (UTC) Date: Mon, 14 Oct 2019 17:50:21 +0200 From: Alexandre Belloni To: Nick Crews Cc: Alessandro Zummo , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Pavel Machek , enric.balletbo@collabora.com, bleung@chromium.org, dlaurie@chromium.org, djkurtz@chromium.org, dtor@google.com, campello@chromium.org Subject: Re: [PATCH v4] rtc: wilco-ec: Handle reading invalid times Message-ID: <20191014155021.GR3125@piout.net> References: <20191004142608.170159-1-ncrews@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191004142608.170159-1-ncrews@chromium.org> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-rtc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org On 04/10/2019 08:26:08-0600, Nick Crews wrote: > If the RTC HW returns an invalid time, the rtc_year_days() > call would crash. This patch adds error logging in this > situation, and removes the tm_yday and tm_wday calculations. > These fields should not be relied upon by userspace > according to man rtc, and thus we don't need to calculate > them. > > Signed-off-by: Nick Crews > --- > drivers/rtc/rtc-wilco-ec.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > Applied, thanks. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com