linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thunderbolt: make tb_domain_type const
@ 2017-09-30 16:37 Bhumika Goyal
  2017-10-02  9:28 ` Mika Westerberg
  0 siblings, 1 reply; 2+ messages in thread
From: Bhumika Goyal @ 2017-09-30 16:37 UTC (permalink / raw)
  To: julia.lawall, andreas.noever, michael.jamet, mika.westerberg,
	yehezkel.bernat, linux-kernel
  Cc: Bhumika Goyal

Make this const as it is only stored in the const field of a device
structure. Make the declaration in header const too.

Structure found using Coccinelle and changes done by hand.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/thunderbolt/domain.c | 2 +-
 drivers/thunderbolt/tb.h     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c
index 9f2dcd4..f8b11a3 100644
--- a/drivers/thunderbolt/domain.c
+++ b/drivers/thunderbolt/domain.c
@@ -65,7 +65,7 @@ static void tb_domain_release(struct device *dev)
 	kfree(tb);
 }
 
-struct device_type tb_domain_type = {
+const struct device_type tb_domain_type = {
 	.name = "thunderbolt_domain",
 	.release = tb_domain_release,
 };
diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h
index e0deee4..fa65049 100644
--- a/drivers/thunderbolt/tb.h
+++ b/drivers/thunderbolt/tb.h
@@ -369,7 +369,7 @@ static inline int tb_port_write(struct tb_port *port, const void *buffer,
 struct tb *tb_probe(struct tb_nhi *nhi);
 
 extern struct bus_type tb_bus_type;
-extern struct device_type tb_domain_type;
+extern const struct device_type tb_domain_type;
 extern struct device_type tb_switch_type;
 
 int tb_domain_init(void);
-- 
1.9.1

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

* Re: [PATCH] thunderbolt: make tb_domain_type const
  2017-09-30 16:37 [PATCH] thunderbolt: make tb_domain_type const Bhumika Goyal
@ 2017-10-02  9:28 ` Mika Westerberg
  0 siblings, 0 replies; 2+ messages in thread
From: Mika Westerberg @ 2017-10-02  9:28 UTC (permalink / raw)
  To: Bhumika Goyal
  Cc: julia.lawall, andreas.noever, michael.jamet, yehezkel.bernat,
	linux-kernel, Greg Kroah-Hartman

On Sat, Sep 30, 2017 at 10:07:12PM +0530, Bhumika Goyal wrote:
> Make this const as it is only stored in the const field of a device
> structure. Make the declaration in header const too.
> 
> Structure found using Coccinelle and changes done by hand.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

This looks good. However, I'm currently doing some shuffling in
drivers/thunderbolt/tb.h to get Thunderbolt services supported which
makes this patch not to apply cleanly anymore:

https://lkml.org/lkml/2017/9/25/225

I wonder if you could rebase your patch on top of that?

Also please Cc Greg as well.

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

end of thread, other threads:[~2017-10-02  9:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-30 16:37 [PATCH] thunderbolt: make tb_domain_type const Bhumika Goyal
2017-10-02  9:28 ` Mika Westerberg

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