linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: allwinner: phy-sun6i-mipi-dphy: Constify structs
@ 2020-06-29 19:57 Rikard Falkeborn
  2020-06-30  7:30 ` Maxime Ripard
  2020-07-08 11:16 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Rikard Falkeborn @ 2020-06-29 19:57 UTC (permalink / raw)
  To: mripard, wens
  Cc: kishon, vkoul, linux-kernel, linux-arm-kernel, Rikard Falkeborn

sun6i_dphy_ops and sun6i_dphy_regmap_config are not modified so make them
const structs to allow the compiler to put them in read-only memory.

Before:
   text    data     bss     dec     hex filename
   4407    1944      64    6415    190f drivers/phy/allwinner/phy-sun6i-mipi-dphy.o

After:
   text    data     bss     dec     hex filename
   4835    1496      64    6395    18fb drivers/phy/allwinner/phy-sun6i-mipi-dphy.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/phy/allwinner/phy-sun6i-mipi-dphy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c
index 79c8af5c7c1d..1fa761ba6cbb 100644
--- a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c
+++ b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c
@@ -233,7 +233,7 @@ static int sun6i_dphy_exit(struct phy *phy)
 }
 
 
-static struct phy_ops sun6i_dphy_ops = {
+static const struct phy_ops sun6i_dphy_ops = {
 	.configure	= sun6i_dphy_configure,
 	.power_on	= sun6i_dphy_power_on,
 	.power_off	= sun6i_dphy_power_off,
@@ -241,7 +241,7 @@ static struct phy_ops sun6i_dphy_ops = {
 	.exit		= sun6i_dphy_exit,
 };
 
-static struct regmap_config sun6i_dphy_regmap_config = {
+static const struct regmap_config sun6i_dphy_regmap_config = {
 	.reg_bits	= 32,
 	.val_bits	= 32,
 	.reg_stride	= 4,
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] phy: allwinner: phy-sun6i-mipi-dphy: Constify structs
  2020-06-29 19:57 [PATCH] phy: allwinner: phy-sun6i-mipi-dphy: Constify structs Rikard Falkeborn
@ 2020-06-30  7:30 ` Maxime Ripard
  2020-07-08 11:16 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2020-06-30  7:30 UTC (permalink / raw)
  To: Rikard Falkeborn; +Cc: wens, kishon, vkoul, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 658 bytes --]

On Mon, Jun 29, 2020 at 09:57:27PM +0200, Rikard Falkeborn wrote:
> sun6i_dphy_ops and sun6i_dphy_regmap_config are not modified so make them
> const structs to allow the compiler to put them in read-only memory.
> 
> Before:
>    text    data     bss     dec     hex filename
>    4407    1944      64    6415    190f drivers/phy/allwinner/phy-sun6i-mipi-dphy.o
> 
> After:
>    text    data     bss     dec     hex filename
>    4835    1496      64    6395    18fb drivers/phy/allwinner/phy-sun6i-mipi-dphy.o
> 
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

Acked-by: Maxime Ripard <mripard@kernel.org>

Thanks!
Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] phy: allwinner: phy-sun6i-mipi-dphy: Constify structs
  2020-06-29 19:57 [PATCH] phy: allwinner: phy-sun6i-mipi-dphy: Constify structs Rikard Falkeborn
  2020-06-30  7:30 ` Maxime Ripard
@ 2020-07-08 11:16 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2020-07-08 11:16 UTC (permalink / raw)
  To: Rikard Falkeborn; +Cc: mripard, wens, kishon, linux-kernel, linux-arm-kernel

On 29-06-20, 21:57, Rikard Falkeborn wrote:
> sun6i_dphy_ops and sun6i_dphy_regmap_config are not modified so make them
> const structs to allow the compiler to put them in read-only memory.
> 
> Before:
>    text    data     bss     dec     hex filename
>    4407    1944      64    6415    190f drivers/phy/allwinner/phy-sun6i-mipi-dphy.o
> 
> After:
>    text    data     bss     dec     hex filename
>    4835    1496      64    6395    18fb drivers/phy/allwinner/phy-sun6i-mipi-dphy.o

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-08 11:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29 19:57 [PATCH] phy: allwinner: phy-sun6i-mipi-dphy: Constify structs Rikard Falkeborn
2020-06-30  7:30 ` Maxime Ripard
2020-07-08 11:16 ` Vinod Koul

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).