From patchwork Thu Nov 19 10:50:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 7656421 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B47FBBF90C for ; Thu, 19 Nov 2015 10:54:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9D31C205FA for ; Thu, 19 Nov 2015 10:54:08 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id D644D2053E for ; Thu, 19 Nov 2015 10:54:07 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZzMpC-0004Wv-3u; Thu, 19 Nov 2015 10:52:22 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZzMp7-0004Kw-NI for linux-arm-kernel@lists.infradead.org; Thu, 19 Nov 2015 10:52:18 +0000 Received: by wmvv187 with SMTP id v187so19068219wmv.1 for ; Thu, 19 Nov 2015 02:51:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sn/xGeiX89hR7G0irTK0LObEIJeJvM7JsjflXzOLZ44=; b=cNjfHwQ1xNlF+8x7JTdWhPOXVMKfbE49Dq0r87AQsyFK9KVyQULiI35/uowN9DWdC1 eg8yn7+/YTcCxeq3kCIunC1xyiHCRiLQxzAcrUeXKtZAnxyBDnFGbc0Wk6AYzwhNFky2 cVkFf5gQ2ea4Tw/x8AThtizrrbsm9ap283MsGYxXqY7D4Gjy2OpH4pvmQdYQ8agwAxT3 b/mCuOxp3L6abU8/vW//cEvhimKSA+8AhBBifrcnPCGqftT5Md6BcYi2vVLh7Qlj7asr tWxYZqRXuqyE8u/XXMHIDeQuWRGkERVyT7NNNSKU5llXCeGE1T5CXgocUtggm/hIpKBo riOw== X-Received: by 10.28.176.70 with SMTP id z67mr10336349wme.5.1447930316076; Thu, 19 Nov 2015 02:51:56 -0800 (PST) Received: from Red.local (ANice-651-1-376-123.w86-193.abo.wanadoo.fr. [86.193.8.123]) by smtp.googlemail.com with ESMTPSA id z1sm7267760wje.35.2015.11.19.02.51.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Nov 2015 02:51:55 -0800 (PST) From: LABBE Corentin To: alexandre.belloni@free-electrons.com, a.zummo@towertech.it, linux-arm-kernel@lists.infradead.org, maxime.ripard@free-electrons.com, wens@csie.org Subject: [PATCH 2/3] rtc: sunxi: constify the data_year_param structure Date: Thu, 19 Nov 2015 11:50:09 +0100 Message-Id: <1447930210-27008-2-git-send-email-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.4.10 In-Reply-To: <1447930210-27008-1-git-send-email-clabbe.montjoie@gmail.com> References: <1447930210-27008-1-git-send-email-clabbe.montjoie@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151119_025218_005784_D6B4B4B9 X-CRM114-Status: GOOD ( 12.78 ) X-Spam-Score: -2.7 (--) 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: LABBE Corentin , linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The data_year_param struct is never modified, so lets constify it. This permit to remove cast since of_device_id is const also. Signed-off-by: LABBE Corentin Acked-by: Chen-Yu Tsai --- drivers/rtc/rtc-sunxi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-sunxi.c b/drivers/rtc/rtc-sunxi.c index b4f35ac..0c08a5b 100644 --- a/drivers/rtc/rtc-sunxi.c +++ b/drivers/rtc/rtc-sunxi.c @@ -133,7 +133,7 @@ struct sunxi_rtc_data_year { unsigned char leap_shift; /* bit shift to get the leap year */ }; -static struct sunxi_rtc_data_year data_year_param[] = { +static const struct sunxi_rtc_data_year data_year_param[] = { [0] = { .min = 2010, .max = 2073, @@ -151,7 +151,7 @@ static struct sunxi_rtc_data_year data_year_param[] = { struct sunxi_rtc_dev { struct rtc_device *rtc; struct device *dev; - struct sunxi_rtc_data_year *data_year; + const struct sunxi_rtc_data_year *data_year; void __iomem *base; int irq; }; @@ -468,7 +468,7 @@ static int sunxi_rtc_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Unable to setup RTC data\n"); return -ENODEV; } - chip->data_year = (struct sunxi_rtc_data_year *) of_id->data; + chip->data_year = of_id->data; /* clear the alarm count value */ writel(0, chip->base + SUNXI_ALRM_DHMS);