Commit 6fb8ac81 authored by Julia Lawall's avatar Julia Lawall Committed by Greg Kroah-Hartman

USB: constify usb_mon_operations structure

The usb_mon_operations structure is never modified, so declare it as const.

Done with the help of Coccinelle.
Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c7c78067
...@@ -3000,7 +3000,7 @@ EXPORT_SYMBOL_GPL(usb_hcd_platform_shutdown); ...@@ -3000,7 +3000,7 @@ EXPORT_SYMBOL_GPL(usb_hcd_platform_shutdown);
#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)
struct usb_mon_operations *mon_ops; const struct usb_mon_operations *mon_ops;
/* /*
* The registration is unlocked. * The registration is unlocked.
...@@ -3010,7 +3010,7 @@ struct usb_mon_operations *mon_ops; ...@@ -3010,7 +3010,7 @@ struct usb_mon_operations *mon_ops;
* symbols from usbcore, usbcore gets referenced and cannot be unloaded first. * symbols from usbcore, usbcore gets referenced and cannot be unloaded first.
*/ */
int usb_mon_register (struct usb_mon_operations *ops) int usb_mon_register(const struct usb_mon_operations *ops)
{ {
if (mon_ops) if (mon_ops)
......
...@@ -241,7 +241,7 @@ static struct notifier_block mon_nb = { ...@@ -241,7 +241,7 @@ static struct notifier_block mon_nb = {
/* /*
* Ops * Ops
*/ */
static struct usb_mon_operations mon_ops_0 = { static const struct usb_mon_operations mon_ops_0 = {
.urb_submit = mon_submit, .urb_submit = mon_submit,
.urb_submit_error = mon_submit_error, .urb_submit_error = mon_submit_error,
.urb_complete = mon_complete, .urb_complete = mon_complete,
......
...@@ -660,7 +660,7 @@ struct usb_mon_operations { ...@@ -660,7 +660,7 @@ struct usb_mon_operations {
/* void (*urb_unlink)(struct usb_bus *bus, struct urb *urb); */ /* void (*urb_unlink)(struct usb_bus *bus, struct urb *urb); */
}; };
extern struct usb_mon_operations *mon_ops; extern const struct usb_mon_operations *mon_ops;
static inline void usbmon_urb_submit(struct usb_bus *bus, struct urb *urb) static inline void usbmon_urb_submit(struct usb_bus *bus, struct urb *urb)
{ {
...@@ -682,7 +682,7 @@ static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb, ...@@ -682,7 +682,7 @@ static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb,
(*mon_ops->urb_complete)(bus, urb, status); (*mon_ops->urb_complete)(bus, urb, status);
} }
int usb_mon_register(struct usb_mon_operations *ops); int usb_mon_register(const struct usb_mon_operations *ops);
void usb_mon_deregister(void); void usb_mon_deregister(void);
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment