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

Commit 066202dd authored by Luiz Fernando N. Capitulino's avatar Luiz Fernando N. Capitulino Committed by Greg Kroah-Hartman
Browse files

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: default avatarLuiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f2ebf92c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -813,7 +813,7 @@ static unsigned int usblp_quirks (__u16 vendor, __u16 product)
	return 0;
}

static struct file_operations usblp_fops = {
static const struct file_operations usblp_fops = {
	.owner =	THIS_MODULE,
	.read =		usblp_read,
	.write =	usblp_write,
+1 −1
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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,
};
+3 −3
Original line number Diff line number Diff line
@@ -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;
Loading