aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2007-01-14 09:29:07 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-03-09 16:02:39 -0500
commit21ebcd1224d05c8673053e1e93ab9ec7ef3e0b84 (patch)
tree1f6f1c05bc8c0fa814a2265ca8dbb24e92bdcab9 /drivers
parent227e7d8194bd147484f6ae135a082ce22112b5b3 (diff)
firewire: mark some structs const
Instances of struct file_operations and struct fw_card_driver can be qualified as "const". Ditto with struct fw_descriptor.data, struct fw_device_id, and predefined instances of struct fw_address_region, at least in the current implementation. Data qualified as const is placed into the .rodata section which won't be mixed with dirty data. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firewire/fw-card.c2
-rw-r--r--drivers/firewire/fw-device-cdev.c2
-rw-r--r--drivers/firewire/fw-device.c2
-rw-r--r--drivers/firewire/fw-device.h4
-rw-r--r--drivers/firewire/fw-ohci.c2
-rw-r--r--drivers/firewire/fw-sbp2.c2
-rw-r--r--drivers/firewire/fw-transaction.c14
-rw-r--r--drivers/firewire/fw-transaction.h18
8 files changed, 23 insertions, 23 deletions
diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index 79773907e10d..82a92432bcb7 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -257,7 +257,7 @@ flush_timer_callback(unsigned long data)
257} 257}
258 258
259void 259void
260fw_card_initialize(struct fw_card *card, struct fw_card_driver *driver, 260fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver,
261 struct device *device) 261 struct device *device)
262{ 262{
263 static int index; 263 static int index;
diff --git a/drivers/firewire/fw-device-cdev.c b/drivers/firewire/fw-device-cdev.c
index c10e3326abf3..117bc6db54af 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -602,7 +602,7 @@ static unsigned int fw_device_op_poll(struct file *file, poll_table * pt)
602 return 0; 602 return 0;
603} 603}
604 604
605struct file_operations fw_device_ops = { 605const struct file_operations fw_device_ops = {
606 .owner = THIS_MODULE, 606 .owner = THIS_MODULE,
607 .open = fw_device_op_open, 607 .open = fw_device_op_open,
608 .read = fw_device_op_read, 608 .read = fw_device_op_read,
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index ec1cb7fc8e96..e541daade0c3 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -49,7 +49,7 @@ EXPORT_SYMBOL(fw_csr_iterator_next);
49 49
50static int is_fw_unit(struct device *dev); 50static int is_fw_unit(struct device *dev);
51 51
52static int match_unit_directory(u32 * directory, struct fw_device_id *id) 52static int match_unit_directory(u32 * directory, const struct fw_device_id *id)
53{ 53{
54 struct fw_csr_iterator ci; 54 struct fw_csr_iterator ci;
55 int key, value, match; 55 int key, value, match;
diff --git a/drivers/firewire/fw-device.h b/drivers/firewire/fw-device.h
index 731abbe5330b..f39cf6ae6253 100644
--- a/drivers/firewire/fw-device.h
+++ b/drivers/firewire/fw-device.h
@@ -113,7 +113,7 @@ struct fw_driver {
113 struct device_driver driver; 113 struct device_driver driver;
114 /* Called when the parent device sits through a bus reset. */ 114 /* Called when the parent device sits through a bus reset. */
115 void (*update) (struct fw_unit *unit); 115 void (*update) (struct fw_unit *unit);
116 struct fw_device_id *id_table; 116 const struct fw_device_id *id_table;
117}; 117};
118 118
119static inline struct fw_driver * 119static inline struct fw_driver *
@@ -122,6 +122,6 @@ fw_driver(struct device_driver *drv)
122 return container_of(drv, struct fw_driver, driver); 122 return container_of(drv, struct fw_driver, driver);
123} 123}
124 124
125extern struct file_operations fw_device_ops; 125extern const struct file_operations fw_device_ops;
126 126
127#endif /* __fw_device_h */ 127#endif /* __fw_device_h */
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 5d42d18bd455..d3750a2692e9 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1146,7 +1146,7 @@ ohci_queue_iso(struct fw_iso_context *base,
1146 return 0; 1146 return 0;
1147} 1147}
1148 1148
1149static struct fw_card_driver ohci_driver = { 1149static const struct fw_card_driver ohci_driver = {
1150 .name = ohci_driver_name, 1150 .name = ohci_driver_name,
1151 .enable = ohci_enable, 1151 .enable = ohci_enable,
1152 .update_phy_reg = ohci_update_phy_reg, 1152 .update_phy_reg = ohci_update_phy_reg,
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index ce9c41ff0765..28acae8b01b3 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -681,7 +681,7 @@ static void sbp2_update(struct fw_unit *unit)
681#define SBP2_UNIT_SPEC_ID_ENTRY 0x0000609e 681#define SBP2_UNIT_SPEC_ID_ENTRY 0x0000609e
682#define SBP2_SW_VERSION_ENTRY 0x00010483 682#define SBP2_SW_VERSION_ENTRY 0x00010483
683 683
684static struct fw_device_id sbp2_id_table[] = { 684static const struct fw_device_id sbp2_id_table[] = {
685 { 685 {
686 .match_flags = FW_MATCH_SPECIFIER_ID | FW_MATCH_VERSION, 686 .match_flags = FW_MATCH_SPECIFIER_ID | FW_MATCH_VERSION,
687 .specifier_id = SBP2_UNIT_SPEC_ID_ENTRY, 687 .specifier_id = SBP2_UNIT_SPEC_ID_ENTRY,
diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c
index affd42014a67..a72f50288c0a 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -331,15 +331,15 @@ lookup_enclosing_address_handler(struct list_head *list,
331static DEFINE_SPINLOCK(address_handler_lock); 331static DEFINE_SPINLOCK(address_handler_lock);
332static LIST_HEAD(address_handler_list); 332static LIST_HEAD(address_handler_list);
333 333
334struct fw_address_region fw_low_memory_region = 334const struct fw_address_region fw_low_memory_region =
335 { 0x000000000000ull, 0x000100000000ull }; 335 { 0x000000000000ull, 0x000100000000ull };
336struct fw_address_region fw_high_memory_region = 336const struct fw_address_region fw_high_memory_region =
337 { 0x000100000000ull, 0xffffe0000000ull }; 337 { 0x000100000000ull, 0xffffe0000000ull };
338struct fw_address_region fw_private_region = 338const struct fw_address_region fw_private_region =
339 { 0xffffe0000000ull, 0xfffff0000000ull }; 339 { 0xffffe0000000ull, 0xfffff0000000ull };
340struct fw_address_region fw_csr_region = 340const struct fw_address_region fw_csr_region =
341 { 0xfffff0000000ULL, 0xfffff0000800ull }; 341 { 0xfffff0000000ULL, 0xfffff0000800ull };
342struct fw_address_region fw_unit_space_region = 342const struct fw_address_region fw_unit_space_region =
343 { 0xfffff0000900ull, 0x1000000000000ull }; 343 { 0xfffff0000900ull, 0x1000000000000ull };
344 344
345EXPORT_SYMBOL(fw_low_memory_region); 345EXPORT_SYMBOL(fw_low_memory_region);
@@ -358,7 +358,7 @@ EXPORT_SYMBOL(fw_unit_space_region);
358 358
359int 359int
360fw_core_add_address_handler(struct fw_address_handler *handler, 360fw_core_add_address_handler(struct fw_address_handler *handler,
361 struct fw_address_region *region) 361 const struct fw_address_region *region)
362{ 362{
363 struct fw_address_handler *other; 363 struct fw_address_handler *other;
364 unsigned long flags; 364 unsigned long flags;
@@ -684,7 +684,7 @@ MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>");
684MODULE_DESCRIPTION("Core IEEE1394 transaction logic"); 684MODULE_DESCRIPTION("Core IEEE1394 transaction logic");
685MODULE_LICENSE("GPL"); 685MODULE_LICENSE("GPL");
686 686
687static u32 vendor_textual_descriptor_data[] = { 687static const u32 vendor_textual_descriptor_data[] = {
688 /* textual descriptor leaf () */ 688 /* textual descriptor leaf () */
689 0x00080000, 689 0x00080000,
690 0x00000000, 690 0x00000000,
diff --git a/drivers/firewire/fw-transaction.h b/drivers/firewire/fw-transaction.h
index 292add509102..2f849c813a4c 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
@@ -133,7 +133,7 @@ struct fw_descriptor {
133 struct list_head link; 133 struct list_head link;
134 size_t length; 134 size_t length;
135 u32 key; 135 u32 key;
136 u32 *data; 136 const u32 *data;
137}; 137};
138 138
139int fw_core_add_descriptor (struct fw_descriptor *desc); 139int fw_core_add_descriptor (struct fw_descriptor *desc);
@@ -218,14 +218,14 @@ struct fw_address_region {
218 u64 end; 218 u64 end;
219}; 219};
220 220
221extern struct fw_address_region fw_low_memory_region; 221extern const struct fw_address_region fw_low_memory_region;
222extern struct fw_address_region fw_high_memory_region; 222extern const struct fw_address_region fw_high_memory_region;
223extern struct fw_address_region fw_private_region; 223extern const struct fw_address_region fw_private_region;
224extern struct fw_address_region fw_csr_region; 224extern const struct fw_address_region fw_csr_region;
225extern struct fw_address_region fw_unit_space_region; 225extern const struct fw_address_region fw_unit_space_region;
226 226
227int fw_core_add_address_handler(struct fw_address_handler *handler, 227int fw_core_add_address_handler(struct fw_address_handler *handler,
228 struct fw_address_region *region); 228 const struct fw_address_region *region);
229void fw_core_remove_address_handler(struct fw_address_handler *handler); 229void fw_core_remove_address_handler(struct fw_address_handler *handler);
230void fw_send_response(struct fw_card *card, 230void fw_send_response(struct fw_card *card,
231 struct fw_request *request, int rcode); 231 struct fw_request *request, int rcode);
@@ -233,7 +233,7 @@ void fw_send_response(struct fw_card *card,
233extern struct bus_type fw_bus_type; 233extern struct bus_type fw_bus_type;
234 234
235struct fw_card { 235struct fw_card {
236 struct fw_card_driver *driver; 236 const struct fw_card_driver *driver;
237 struct device *device; 237 struct device *device;
238 238
239 int node_id; 239 int node_id;
@@ -399,7 +399,7 @@ fw_node_event(struct fw_card *card, struct fw_node *node, int event);
399/* Do we need phy speed here also? If we add more args, maybe we 399/* Do we need phy speed here also? If we add more args, maybe we
400 should go back to struct fw_card_info. */ 400 should go back to struct fw_card_info. */
401void 401void
402fw_card_initialize(struct fw_card *card, struct fw_card_driver *driver, 402fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver,
403 struct device *device); 403 struct device *device);
404int 404int
405fw_card_add(struct fw_card *card, 405fw_card_add(struct fw_card *card,