* [PATCH] i2c: busses: constify dev_pm_ops structures
@ 2017-01-15 9:59 Bhumika Goyal
2017-01-17 23:23 ` Tony Lindgren
2017-01-25 21:03 ` Wolfram Sang
0 siblings, 2 replies; 3+ messages in thread
From: Bhumika Goyal @ 2017-01-15 9:59 UTC (permalink / raw)
To: julia.lawall, tony, wsa, linux-omap, linux-i2c, linux-kernel
Cc: Bhumika Goyal
Declare dev_pm_ops structures as const as they are only stored in the pm
field of a device_driver structure. This field is of type const, so
dev_pm_ops structures having similar properties can be declared const
too.
File size before: drivers/i2c/busses/i2c-omap.o
text data bss dec hex filename
6814 584 0 7398 1ce6 drivers/i2c/busses/i2c-omap.o
File size after: drivers/i2c/busses/i2c-omap.o
text data bss dec hex filename
7006 392 0 7398 1ce6 drivers/i2c/busses/i2c-omap.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
drivers/i2c/busses/i2c-omap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index c7da0c4..1ebb5e9 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -1504,7 +1504,7 @@ static int omap_i2c_runtime_resume(struct device *dev)
return 0;
}
-static struct dev_pm_ops omap_i2c_pm_ops = {
+static const struct dev_pm_ops omap_i2c_pm_ops = {
SET_RUNTIME_PM_OPS(omap_i2c_runtime_suspend,
omap_i2c_runtime_resume, NULL)
};
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: busses: constify dev_pm_ops structures
2017-01-15 9:59 [PATCH] i2c: busses: constify dev_pm_ops structures Bhumika Goyal
@ 2017-01-17 23:23 ` Tony Lindgren
2017-01-25 21:03 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2017-01-17 23:23 UTC (permalink / raw)
To: Bhumika Goyal; +Cc: julia.lawall, wsa, linux-omap, linux-i2c, linux-kernel
* Bhumika Goyal <bhumirks@gmail.com> [170115 02:00]:
> Declare dev_pm_ops structures as const as they are only stored in the pm
> field of a device_driver structure. This field is of type const, so
> dev_pm_ops structures having similar properties can be declared const
> too.
>
> File size before: drivers/i2c/busses/i2c-omap.o
> text data bss dec hex filename
> 6814 584 0 7398 1ce6 drivers/i2c/busses/i2c-omap.o
>
> File size after: drivers/i2c/busses/i2c-omap.o
> text data bss dec hex filename
> 7006 392 0 7398 1ce6 drivers/i2c/busses/i2c-omap.o
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>
> ---
> drivers/i2c/busses/i2c-omap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index c7da0c4..1ebb5e9 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -1504,7 +1504,7 @@ static int omap_i2c_runtime_resume(struct device *dev)
> return 0;
> }
>
> -static struct dev_pm_ops omap_i2c_pm_ops = {
> +static const struct dev_pm_ops omap_i2c_pm_ops = {
> SET_RUNTIME_PM_OPS(omap_i2c_runtime_suspend,
> omap_i2c_runtime_resume, NULL)
> };
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: busses: constify dev_pm_ops structures
2017-01-15 9:59 [PATCH] i2c: busses: constify dev_pm_ops structures Bhumika Goyal
2017-01-17 23:23 ` Tony Lindgren
@ 2017-01-25 21:03 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2017-01-25 21:03 UTC (permalink / raw)
To: Bhumika Goyal; +Cc: julia.lawall, tony, linux-omap, linux-i2c, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 845 bytes --]
On Sun, Jan 15, 2017 at 03:29:41PM +0530, Bhumika Goyal wrote:
> Declare dev_pm_ops structures as const as they are only stored in the pm
> field of a device_driver structure. This field is of type const, so
> dev_pm_ops structures having similar properties can be declared const
> too.
>
> File size before: drivers/i2c/busses/i2c-omap.o
> text data bss dec hex filename
> 6814 584 0 7398 1ce6 drivers/i2c/busses/i2c-omap.o
>
> File size after: drivers/i2c/busses/i2c-omap.o
> text data bss dec hex filename
> 7006 392 0 7398 1ce6 drivers/i2c/busses/i2c-omap.o
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Applied to for-next, thanks! I dropped the file size table from the
commit message, though. For me, it is clear enough without it.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-25 21:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-15 9:59 [PATCH] i2c: busses: constify dev_pm_ops structures Bhumika Goyal
2017-01-17 23:23 ` Tony Lindgren
2017-01-25 21:03 ` Wolfram Sang
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).