Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3535280imu; Mon, 7 Jan 2019 05:14:45 -0800 (PST) X-Google-Smtp-Source: ALg8bN61vUTjpl1sIJNThXR5c63an8I8TUoSZgCoyWYQE2ADT2o3PZN44p5nBtjgyi6yso4wqMOX X-Received: by 2002:a17:902:8e8a:: with SMTP id bg10mr61287935plb.192.1546866885008; Mon, 07 Jan 2019 05:14:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546866884; cv=none; d=google.com; s=arc-20160816; b=FzKsgesNrY3Ia5ESKU77EGRXf83zIeCw1b59KQoy0wwNSRy9ymWY3XclRm5GLKpBQy 4BYuX2FhXZrXGfMYoA/J7JkX0C00+q6SuBUhamj8/2vCPlJyT2MXwoEkblcMQvuuHDIv gLSStCsxor5cyYlHdt9+9IZwbqUnHVUZqgxF+0TQfJTtMVpgqJyksDr2AgKk4Aa+8jYT kPdoCGlLr3spb4CqEpSndKU0wwU4ygIKYx0amCKXc+ufIVY9sFVnlXu1IzZ1zBwTD2/l w9fE+P0pCWFJR+wWj402IS+2gDCK0aoiP9K+m8KjySSoNs3QB75cfmx4eueQvY3a5RYP GeSA== 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=9sC+uqlWS86Rds2Ub9dRiD5xb5AO4GPGBmRMqlR79mI=; b=0P/JsX8Uq8IiH4yJL5LOHlj0WmuVN0vID98jnFGjwk0JPcuQ92nuteB/BpMGxQZAjE E39t+PbRdgyreVETmnaN31z1qnLQJKpPHb8xbUWvQCDLPsfIdzMNHdt8H6aK0PU1Ap4e HHo8NUYHCU5H9mepjFdRf2oPvG8rpZugu2hEoEF/e1OKsFS4kh2a0qranFNWhPtGReAj gIw/h08ujD/rWFO+sRaHZfcHoifTd7LwPOXkxEptziVhJF8tBVOX+0E8FebrfoH0xCue OoW33GHub1Bd/z4ApeZSeyDX729l0aUPLR1TdDFTOMlTCclElfSB2jQW/vP7u1FrFEyW 6jjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2I3ihExa; 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 j10si26812840pgn.365.2019.01.07.05.14.30; Mon, 07 Jan 2019 05:14:44 -0800 (PST) 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=2I3ihExa; 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 S1731362AbfAGNEW (ORCPT + 99 others); Mon, 7 Jan 2019 08:04:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:51774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731264AbfAGNEM (ORCPT ); Mon, 7 Jan 2019 08:04:12 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 D6678206BB; Mon, 7 Jan 2019 13:04:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546866251; bh=qrB9d1A5BJM3ODAFMbhwwY16VwaWE7X2gN2cYRikbTo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2I3ihExaBKQldWBwfM2SRJW6bFZzVhmjUVBxYzItsCh/crAEulWlizkhN0GJKPdUh Qt/EFcWq/OhvWS2QbllAgH0SYNlmXh0MI1b+qRZJVa8/0uJQOaFRgAsX4jSsDeMt07 xWCHTwmUp0ss4SV2k6816pjSTEOc2SAYTVin7e28= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Maciej W. Rozycki" , Alexandre Belloni Subject: [PATCH 4.14 098/101] rtc: m41t80: Correct alarm month range with RTC reads Date: Mon, 7 Jan 2019 13:33:26 +0100 Message-Id: <20190107105338.116473089@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107105330.372621917@linuxfoundation.org> References: <20190107105330.372621917@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Maciej W. Rozycki commit 3cc9ffbb1f51eb4320575a48e4805a8f52e0e26b upstream. Add the missing adjustment of the month range on alarm reads from the RTC, correcting an issue coming from commit 9c6dfed92c3e ("rtc: m41t80: add alarm functionality"). The range is 1-12 for hardware and 0-11 for `struct rtc_time', and is already correctly handled on alarm writes to the RTC. It was correct up until commit 48e9766726eb ("drivers/rtc/rtc-m41t80.c: remove disabled alarm functionality") too, which removed the previous implementation of alarm support. Signed-off-by: Maciej W. Rozycki Fixes: 9c6dfed92c3e ("rtc: m41t80: add alarm functionality") References: 48e9766726eb ("drivers/rtc/rtc-m41t80.c: remove disabled alarm functionality") Cc: stable@vger.kernel.org # 4.7+ Signed-off-by: Alexandre Belloni Signed-off-by: Greg Kroah-Hartman --- drivers/rtc/rtc-m41t80.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c @@ -404,7 +404,7 @@ static int m41t80_read_alarm(struct devi alrm->time.tm_min = bcd2bin(alarmvals[3] & 0x7f); alrm->time.tm_hour = bcd2bin(alarmvals[2] & 0x3f); alrm->time.tm_mday = bcd2bin(alarmvals[1] & 0x3f); - alrm->time.tm_mon = bcd2bin(alarmvals[0] & 0x3f); + alrm->time.tm_mon = bcd2bin(alarmvals[0] & 0x3f) - 1; alrm->enabled = !!(alarmvals[0] & M41T80_ALMON_AFE); alrm->pending = (flags & M41T80_FLAGS_AF) && alrm->enabled;