diff options
author | Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br> | 2006-08-05 20:37:11 -0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-27 11:58:52 -0700 |
commit | 066202dd48cf3296b6cc22b5fcf89aef33fa0efc (patch) | |
tree | 1730104f5b1634e0dca42c5ea7a331fb1c773813 /drivers/usb/core | |
parent | f2ebf92c9e1930a8f79b7eb49a32122931929014 (diff) |
USB: Make file operations structs in drivers/usb const.
Making structs const prevents accidental bugs and with the proper debug
options they're protected against corruption.
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/devices.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/devio.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/file.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/inode.c | 6 | ||||
-rw-r--r-- | drivers/usb/core/usb.h | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c index c0f37343a276..241d37326ea9 100644 --- a/drivers/usb/core/devices.c +++ b/drivers/usb/core/devices.c @@ -667,7 +667,7 @@ static loff_t usb_device_lseek(struct file * file, loff_t offset, int orig) return ret; } -struct file_operations usbfs_devices_fops = { +const struct file_operations usbfs_devices_fops = { .llseek = usb_device_lseek, .read = usb_device_read, .poll = usb_device_poll, diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index e84f19d4089c..43c08724a2d8 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1572,7 +1572,7 @@ static unsigned int usbdev_poll(struct file *file, struct poll_table_struct *wai return mask; } -struct file_operations usbfs_device_file_operations = { +const struct file_operations usbfs_device_file_operations = { .llseek = usbdev_lseek, .read = usbdev_read, .poll = usbdev_poll, diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index 8de4f8c99d61..c376c655c5de 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c @@ -55,7 +55,7 @@ static int usb_open(struct inode * inode, struct file * file) return err; } -static struct file_operations usb_fops = { +static const struct file_operations usb_fops = { .owner = THIS_MODULE, .open = usb_open, }; diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 58b4b1012120..df3d152f0493 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c @@ -44,7 +44,7 @@ #include "hcd.h" static struct super_operations usbfs_ops; -static struct file_operations default_file_operations; +static const struct file_operations default_file_operations; static struct vfsmount *usbfs_mount; static int usbfs_mount_count; /* = 0 */ static int ignore_mount = 0; @@ -407,7 +407,7 @@ static int default_open (struct inode *inode, struct file *file) return 0; } -static struct file_operations default_file_operations = { +static const struct file_operations default_file_operations = { .read = default_read_file, .write = default_write_file, .open = default_open, @@ -494,7 +494,7 @@ static int fs_create_by_name (const char *name, mode_t mode, static struct dentry *fs_create_file (const char *name, mode_t mode, struct dentry *parent, void *data, - struct file_operations *fops, + const struct file_operations *fops, uid_t uid, gid_t gid) { struct dentry *dentry; diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index 98675fb1bc4c..6096ead2758c 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h @@ -90,8 +90,8 @@ extern const char *usbcore_name; /* usbfs stuff */ extern struct mutex usbfs_mutex; extern struct usb_driver usbfs_driver; -extern struct file_operations usbfs_devices_fops; -extern struct file_operations usbfs_device_file_operations; +extern const struct file_operations usbfs_devices_fops; +extern const struct file_operations usbfs_device_file_operations; extern void usbfs_conn_disc_event(void); extern int usbdev_init(void); |