HID: usbmouse: constify usb_device_id and fix space before '[' error
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Wed, 9 Aug 2017 18:21:35 +0000 (23:51 +0530)
committerJiri Kosina <jkosina@suse.cz>
Thu, 10 Aug 2017 09:07:49 +0000 (11:07 +0200)
usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Fix checkpatch.pl error:
ERROR: space prohibited before open square bracket '['.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/usbhid/usbmouse.c

index dd911c5241d822d9ffd277547a96a583e63aa4cf..589ad7c15a5807d4929ce7e4da018c583bc06d09 100644 (file)
@@ -226,7 +226,7 @@ static void usb_mouse_disconnect(struct usb_interface *intf)
        }
 }
 
-static struct usb_device_id usb_mouse_id_table [] = {
+static const struct usb_device_id usb_mouse_id_table[] = {
        { USB_INTERFACE_INFO(USB_INTERFACE_CLASS_HID, USB_INTERFACE_SUBCLASS_BOOT,
                USB_INTERFACE_PROTOCOL_MOUSE) },
        { }     /* Terminating entry */