* [PATCH] watchdog: cadence_wdt: make of_device_ids const.
@ 2017-06-20 5:34 Arvind Yadav
2017-06-20 20:53 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-06-20 5:34 UTC (permalink / raw)
To: wim, linux; +Cc: linux-watchdog, linux-kernel
of_device_ids are not supposed to change at runtime. All functions
working with of_device_ids provided by <linux/of.h> work with const
of_device_ids. So mark the non-const structs as const.
File size before:
text data bss dec hex filename
1962 612 4 2578 a12 drivers/watchdog/cadence_wdt.o
File size after constify cdns_wdt_of_match:
text data bss dec hex filename
2378 196 4 2578 a12 drivers/watchdog/cadence_wdt.o
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/watchdog/cadence_wdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
index 8d61e8b..4824b0a 100644
--- a/drivers/watchdog/cadence_wdt.c
+++ b/drivers/watchdog/cadence_wdt.c
@@ -458,7 +458,7 @@ static int __maybe_unused cdns_wdt_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(cdns_wdt_pm_ops, cdns_wdt_suspend, cdns_wdt_resume);
-static struct of_device_id cdns_wdt_of_match[] = {
+static const struct of_device_id cdns_wdt_of_match[] = {
{ .compatible = "cdns,wdt-r1p2", },
{ /* end of table */ }
};
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] watchdog: cadence_wdt: make of_device_ids const.
2017-06-20 5:34 [PATCH] watchdog: cadence_wdt: make of_device_ids const Arvind Yadav
@ 2017-06-20 20:53 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2017-06-20 20:53 UTC (permalink / raw)
To: Arvind Yadav; +Cc: wim, linux-watchdog, linux-kernel
On Tue, Jun 20, 2017 at 11:04:26AM +0530, Arvind Yadav wrote:
> of_device_ids are not supposed to change at runtime. All functions
> working with of_device_ids provided by <linux/of.h> work with const
> of_device_ids. So mark the non-const structs as const.
>
> File size before:
> text data bss dec hex filename
> 1962 612 4 2578 a12 drivers/watchdog/cadence_wdt.o
>
> File size after constify cdns_wdt_of_match:
> text data bss dec hex filename
> 2378 196 4 2578 a12 drivers/watchdog/cadence_wdt.o
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/cadence_wdt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
> index 8d61e8b..4824b0a 100644
> --- a/drivers/watchdog/cadence_wdt.c
> +++ b/drivers/watchdog/cadence_wdt.c
> @@ -458,7 +458,7 @@ static int __maybe_unused cdns_wdt_resume(struct device *dev)
>
> static SIMPLE_DEV_PM_OPS(cdns_wdt_pm_ops, cdns_wdt_suspend, cdns_wdt_resume);
>
> -static struct of_device_id cdns_wdt_of_match[] = {
> +static const struct of_device_id cdns_wdt_of_match[] = {
> { .compatible = "cdns,wdt-r1p2", },
> { /* end of table */ }
> };
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-20 20:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-20 5:34 [PATCH] watchdog: cadence_wdt: make of_device_ids const Arvind Yadav
2017-06-20 20:53 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).