Skip to contentSkip to conversation

firewire: core-device: constify device_type structures

PATCH New Bhumika Goyal 1 participant 1 message Jan 21, 2017 Firewire

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firewire: core-device: constify device_type structures

Declare device_type structures as const as they are only stored in the type field of a device structure. This field is of type const, so device_type structures having similar properties can be declared const too.

File size before:

  text	   data	    bss	    dec	    hex	filename
   8120	    889	     72	   9081	   2379	drivers/firewire/core-device.o

File size after:
text data bss dec hex filename
8248 761 72 9081 2379 drivers/firewire/core-device.o

---
 drivers/firewire/core-device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firewire/core-device.c +2 -2
index f9e3aee..9def58c 100644
@@ -689,7 +689,7 @@ static void fw_unit_release(struct device *dev)
 	kfree(unit);
 }
 
-static struct device_type fw_unit_type = {
+static const struct device_type fw_unit_type = {
 	.uevent		= fw_unit_uevent,
 	.release	= fw_unit_release,
 };
@@ -849,7 +849,7 @@ static void fw_device_release(struct device *dev)
 	fw_card_put(card);
 }
 
-static struct device_type fw_device_type = {
+static const struct device_type fw_device_type = {
 	.release = fw_device_release,
 };
 
Signature · 1 line
2.7.4