Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758375AbbKSKv7 (ORCPT ); Thu, 19 Nov 2015 05:51:59 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:37605 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758355AbbKSKv5 (ORCPT ); Thu, 19 Nov 2015 05:51:57 -0500 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 Cc: LABBE Corentin , linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com 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> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1576 Lines: 47 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 --- 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); -- 2.4.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/