linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: tegra: Constify static device_type structs
@ 2020-11-09 21:58 Rikard Falkeborn
  2020-11-16  7:35 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Rikard Falkeborn @ 2020-11-09 21:58 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul
  Cc: JC Kuo, Thierry Reding, Jonathan Hunter, linux-kernel,
	linux-tegra, Rikard Falkeborn

The only usage of tegra_xusb_pad_type and tegra_xusb_port_type is to
assign their address to the type field in the device struct, which is a
const pointer. Make them const to allow the compiler to put them in
read-only memory.

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

diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index ad88d74c1884..70d95519d281 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -146,7 +146,7 @@ static void tegra_xusb_pad_release(struct device *dev)
 	pad->soc->ops->remove(pad);
 }
 
-static struct device_type tegra_xusb_pad_type = {
+static const struct device_type tegra_xusb_pad_type = {
 	.release = tegra_xusb_pad_release,
 };
 
@@ -513,7 +513,7 @@ static void tegra_xusb_port_release(struct device *dev)
 		port->ops->release(port);
 }
 
-static struct device_type tegra_xusb_port_type = {
+static const struct device_type tegra_xusb_port_type = {
 	.release = tegra_xusb_port_release,
 };
 
-- 
2.29.2


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

* Re: [PATCH] phy: tegra: Constify static device_type structs
  2020-11-09 21:58 [PATCH] phy: tegra: Constify static device_type structs Rikard Falkeborn
@ 2020-11-16  7:35 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2020-11-16  7:35 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Kishon Vijay Abraham I, JC Kuo, Thierry Reding, Jonathan Hunter,
	linux-kernel, linux-tegra

On 09-11-20, 22:58, Rikard Falkeborn wrote:
> The only usage of tegra_xusb_pad_type and tegra_xusb_port_type is to
> assign their address to the type field in the device struct, which is a
> const pointer. Make them const to allow the compiler to put them in
> read-only memory.

Applied, thanks

-- 
~Vinod

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09 21:58 [PATCH] phy: tegra: Constify static device_type structs Rikard Falkeborn
2020-11-16  7:35 ` 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).