thunderbolt: make tb_domain_type const
PATCH 1/1 thunderbolt: make tb_domain_type const
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 <[email protected]>
--- drivers/thunderbolt/domain.c | 2 +- drivers/thunderbolt/tb.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/thunderbolt/domain.c +1 -1
@@ -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, };
drivers/thunderbolt/tb.h +1 -1
@@ -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 );
Signature · 1 line
1.9.1
Quoted 6 lines · 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 <[email protected]>
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.