Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1564186 > unrolled thread

[PATCH] firewire: core-device: constify device_type structures

Started byBhumika Goyal <bhumirks@gmail.com>
First post2017-01-21 18:10 +0100
Last post2017-01-21 18:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] firewire: core-device: constify device_type structures Bhumika Goyal <bhumirks@gmail.com> - 2017-01-21 18:10 +0100

#1564186 — [PATCH] firewire: core-device: constify device_type structures

FromBhumika Goyal <bhumirks@gmail.com>
Date2017-01-21 18:10 +0100
Subject[PATCH] firewire: core-device: constify device_type structures
Message-ID<t27kS-6B1-13@gated-at.bofh.it>
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

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/firewire/core-device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c
index f9e3aee..9def58c 100644
--- a/drivers/firewire/core-device.c
+++ b/drivers/firewire/core-device.c
@@ -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,
 };
 
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web