From patchwork Thu Dec 8 17:10:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 9466727 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E45646071E for ; Thu, 8 Dec 2016 17:12:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE6C228526 for ; Thu, 8 Dec 2016 17:12:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1D1F285E2; Thu, 8 Dec 2016 17:12:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5571D28526 for ; Thu, 8 Dec 2016 17:12:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cF2Dz-0000Ii-E5; Thu, 08 Dec 2016 17:11:15 +0000 Received: from mail.free-electrons.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cF2Dc-00007J-9Y for linux-arm-kernel@lists.infradead.org; Thu, 08 Dec 2016 17:10:53 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id 9627920C2F; Thu, 8 Dec 2016 18:10:32 +0100 (CET) Received: from localhost (83.146.29.93.rev.sfr.net [93.29.146.83]) by mail.free-electrons.com (Postfix) with ESMTPSA id 6CB4920655; Thu, 8 Dec 2016 18:10:32 +0100 (CET) From: Gregory CLEMENT To: Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com Subject: [PATCH 3/3] rtc: armada38x: Prepare for being use on 64 bits Date: Thu, 8 Dec 2016 18:10:10 +0100 Message-Id: <20161208171010.29446-4-gregory.clement@free-electrons.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161208171010.29446-1-gregory.clement@free-electrons.com> References: <20161208171010.29446-1-gregory.clement@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161208_091052_555213_A84946C0 X-CRM114-Status: GOOD ( 11.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Andrew Lunn , Jason Cooper , Gregory CLEMENT , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The drivers are supposed to be portable, however there are few assumption done here about the unsigned long size. Make sure we use the accurate width for the variable. Signed-off-by: Gregory CLEMENT --- drivers/rtc/rtc-armada38x.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-armada38x.c b/drivers/rtc/rtc-armada38x.c index b8a74ffaae80..c4138130febf 100644 --- a/drivers/rtc/rtc-armada38x.c +++ b/drivers/rtc/rtc-armada38x.c @@ -84,14 +84,14 @@ static void rtc_update_mbus_timing_params(struct armada38x_rtc *rtc) } struct str_value_to_freq { - unsigned long value; + u32 value; u8 freq; } __packed; -static unsigned long read_rtc_register_wa(struct armada38x_rtc *rtc, u8 rtc_reg) +static u32 read_rtc_register_wa(struct armada38x_rtc *rtc, u8 rtc_reg) { - unsigned long value_array[SAMPLE_NR], i, j, value; - unsigned long max = 0, index_max = SAMPLE_NR - 1; + int i, j, index_max = SAMPLE_NR - 1; + u32 value_array[SAMPLE_NR], value, max = 0; struct str_value_to_freq value_to_freq[SAMPLE_NR]; for (i = 0; i < SAMPLE_NR; i++) {