Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21ebcd12 authored by Stefan Richter's avatar Stefan Richter
Browse files

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: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
parent 227e7d81
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -257,7 +257,7 @@ flush_timer_callback(unsigned long data)
}

void
fw_card_initialize(struct fw_card *card, struct fw_card_driver *driver,
fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver,
		   struct device *device)
{
	static int index;
+1 −1
Original line number Diff line number Diff line
@@ -602,7 +602,7 @@ static unsigned int fw_device_op_poll(struct file *file, poll_table * pt)
		return 0;
}

struct file_operations fw_device_ops = {
const struct file_operations fw_device_ops = {
	.owner		= THIS_MODULE,
	.open		= fw_device_op_open,
	.read		= fw_device_op_read,
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ EXPORT_SYMBOL(fw_csr_iterator_next);

static int is_fw_unit(struct device *dev);

static int match_unit_directory(u32 * directory, struct fw_device_id *id)
static int match_unit_directory(u32 * directory, const struct fw_device_id *id)
{
	struct fw_csr_iterator ci;
	int key, value, match;
+2 −2
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ struct fw_driver {
	struct device_driver driver;
	/* Called when the parent device sits through a bus reset. */
	void (*update) (struct fw_unit *unit);
	struct fw_device_id *id_table;
	const struct fw_device_id *id_table;
};

static inline struct fw_driver *
@@ -122,6 +122,6 @@ fw_driver(struct device_driver *drv)
        return container_of(drv, struct fw_driver, driver);
}

extern struct file_operations fw_device_ops;
extern const struct file_operations fw_device_ops;

#endif /* __fw_device_h */
+1 −1
Original line number Diff line number Diff line
@@ -1146,7 +1146,7 @@ ohci_queue_iso(struct fw_iso_context *base,
	return 0;
}

static struct fw_card_driver ohci_driver = {
static const struct fw_card_driver ohci_driver = {
	.name			= ohci_driver_name,
	.enable			= ohci_enable,
	.update_phy_reg		= ohci_update_phy_reg,
Loading