Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: usb: constify usb_device_id

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.

'drivers/media/usb/b2c2/flexcop-usb.c' Fix checkpatch.pl error:
ERROR: space prohibited before open square bracket '['.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Arvind Yadav and committed by
Mauro Carvalho Chehab
7fb2e072 a3b215ea

+17 -17
+1 -1
drivers/media/usb/airspy/airspy.c
··· 1087 1087 } 1088 1088 1089 1089 /* USB device ID list */ 1090 - static struct usb_device_id airspy_id_table[] = { 1090 + static const struct usb_device_id airspy_id_table[] = { 1091 1091 { USB_DEVICE(0x1d50, 0x60a1) }, /* AirSpy */ 1092 1092 { } 1093 1093 };
+1 -1
drivers/media/usb/as102/as102_usb_drv.c
··· 33 33 static int as102_open(struct inode *inode, struct file *file); 34 34 static int as102_release(struct inode *inode, struct file *file); 35 35 36 - static struct usb_device_id as102_usb_id_table[] = { 36 + static const struct usb_device_id as102_usb_id_table[] = { 37 37 { USB_DEVICE(AS102_USB_DEVICE_VENDOR_ID, AS102_USB_DEVICE_PID_0001) }, 38 38 { USB_DEVICE(PCTV_74E_USB_VID, PCTV_74E_USB_PID) }, 39 39 { USB_DEVICE(ELGATO_EYETV_DTT_USB_VID, ELGATO_EYETV_DTT_USB_PID) },
+1 -1
drivers/media/usb/b2c2/flexcop-usb.c
··· 596 596 info("%s successfully deinitialized and disconnected.", DRIVER_NAME); 597 597 } 598 598 599 - static struct usb_device_id flexcop_usb_table [] = { 599 + static const struct usb_device_id flexcop_usb_table[] = { 600 600 { USB_DEVICE(0x0af7, 0x0101) }, 601 601 { } 602 602 };
+1 -1
drivers/media/usb/cpia2/cpia2_usb.c
··· 60 60 static int set_alternate(struct camera_data *cam, unsigned int alt); 61 61 static int configure_transfer_mode(struct camera_data *cam, unsigned int alt); 62 62 63 - static struct usb_device_id cpia2_id_table[] = { 63 + static const struct usb_device_id cpia2_id_table[] = { 64 64 {USB_DEVICE(0x0553, 0x0100)}, 65 65 {USB_DEVICE(0x0553, 0x0140)}, 66 66 {USB_DEVICE(0x0553, 0x0151)}, /* STV0676 */
+1 -1
drivers/media/usb/dvb-usb-v2/az6007.c
··· 933 933 } 934 934 }; 935 935 936 - static struct usb_device_id az6007_usb_table[] = { 936 + static const struct usb_device_id az6007_usb_table[] = { 937 937 {DVB_USB_DEVICE(USB_VID_AZUREWAVE, USB_PID_AZUREWAVE_6007, 938 938 &az6007_props, "Azurewave 6007", RC_MAP_EMPTY)}, 939 939 {DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_H7,
+1 -1
drivers/media/usb/hackrf/hackrf.c
··· 1545 1545 } 1546 1546 1547 1547 /* USB device ID list */ 1548 - static struct usb_device_id hackrf_id_table[] = { 1548 + static const struct usb_device_id hackrf_id_table[] = { 1549 1549 { USB_DEVICE(0x1d50, 0x6089) }, /* HackRF One */ 1550 1550 { } 1551 1551 };
+1 -1
drivers/media/usb/hdpvr/hdpvr-core.c
··· 53 53 54 54 55 55 /* table of devices that work with this driver */ 56 - static struct usb_device_id hdpvr_table[] = { 56 + static const struct usb_device_id hdpvr_table[] = { 57 57 { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID) }, 58 58 { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID1) }, 59 59 { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID2) },
+1 -1
drivers/media/usb/msi2500/msi2500.c
··· 1308 1308 } 1309 1309 1310 1310 /* USB device ID list */ 1311 - static struct usb_device_id msi2500_id_table[] = { 1311 + static const struct usb_device_id msi2500_id_table[] = { 1312 1312 {USB_DEVICE(0x1df7, 0x2500)}, /* Mirics MSi3101 SDR Dongle */ 1313 1313 {USB_DEVICE(0x2040, 0xd300)}, /* Hauppauge WinTV 133559 LF */ 1314 1314 {}
+1 -1
drivers/media/usb/s2255/s2255drv.c
··· 381 381 382 382 /* USB device table */ 383 383 #define USB_SENSORAY_VID 0x1943 384 - static struct usb_device_id s2255_table[] = { 384 + static const struct usb_device_id s2255_table[] = { 385 385 {USB_DEVICE(USB_SENSORAY_VID, 0x2255)}, 386 386 {USB_DEVICE(USB_SENSORAY_VID, 0x2257)}, /*same family as 2255*/ 387 387 { } /* Terminating entry */
+1 -1
drivers/media/usb/stk1160/stk1160-core.c
··· 47 47 MODULE_DESCRIPTION("STK1160 driver"); 48 48 49 49 /* Devices supported by this driver */ 50 - static struct usb_device_id stk1160_id_table[] = { 50 + static const struct usb_device_id stk1160_id_table[] = { 51 51 { USB_DEVICE(0x05e1, 0x0408) }, 52 52 { } 53 53 };
+1 -1
drivers/media/usb/stkwebcam/stk-webcam.c
··· 55 55 MODULE_DESCRIPTION("Syntek DC1125 webcam driver"); 56 56 57 57 /* Some cameras have audio interfaces, we aren't interested in those */ 58 - static struct usb_device_id stkwebcam_table[] = { 58 + static const struct usb_device_id stkwebcam_table[] = { 59 59 { USB_DEVICE_AND_INTERFACE_INFO(0x174f, 0xa311, 0xff, 0xff, 0xff) }, 60 60 { USB_DEVICE_AND_INTERFACE_INFO(0x05e1, 0x0501, 0xff, 0xff, 0xff) }, 61 61 { }
+1 -1
drivers/media/usb/tm6000/tm6000-cards.c
··· 613 613 }; 614 614 615 615 /* table of devices that work with this driver */ 616 - static struct usb_device_id tm6000_id_table[] = { 616 + static const struct usb_device_id tm6000_id_table[] = { 617 617 { USB_DEVICE(0x6000, 0x0001), .driver_info = TM5600_BOARD_GENERIC }, 618 618 { USB_DEVICE(0x6000, 0x0002), .driver_info = TM6010_BOARD_GENERIC }, 619 619 { USB_DEVICE(0x06e1, 0xf332), .driver_info = TM6000_BOARD_ADSTECH_DUAL_TV },
+1 -1
drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c
··· 1795 1795 dprintk("%s: TTUSB DVB disconnected\n", __func__); 1796 1796 } 1797 1797 1798 - static struct usb_device_id ttusb_table[] = { 1798 + static const struct usb_device_id ttusb_table[] = { 1799 1799 {USB_DEVICE(0xb48, 0x1003)}, 1800 1800 {USB_DEVICE(0xb48, 0x1004)}, 1801 1801 {USB_DEVICE(0xb48, 0x1005)},
+1 -1
drivers/media/usb/ttusb-dec/ttusb_dec.c
··· 1791 1791 } 1792 1792 } 1793 1793 1794 - static struct usb_device_id ttusb_dec_table[] = { 1794 + static const struct usb_device_id ttusb_dec_table[] = { 1795 1795 {USB_DEVICE(0x0b48, 0x1006)}, /* DEC3000-s */ 1796 1796 /*{USB_DEVICE(0x0b48, 0x1007)}, Unconfirmed */ 1797 1797 {USB_DEVICE(0x0b48, 0x1008)}, /* DEC2000-t */
+1 -1
drivers/media/usb/usbtv/usbtv-core.c
··· 142 142 v4l2_device_put(&usbtv->v4l2_dev); 143 143 } 144 144 145 - static struct usb_device_id usbtv_id_table[] = { 145 + static const struct usb_device_id usbtv_id_table[] = { 146 146 { USB_DEVICE(0x1b71, 0x3002) }, 147 147 {} 148 148 };
+1 -1
drivers/media/usb/uvc/uvc_driver.c
··· 2283 2283 * VENDOR_SPEC because they don't announce themselves as UVC devices, even 2284 2284 * though they are compliant. 2285 2285 */ 2286 - static struct usb_device_id uvc_ids[] = { 2286 + static const struct usb_device_id uvc_ids[] = { 2287 2287 /* LogiLink Wireless Webcam */ 2288 2288 { .match_flags = USB_DEVICE_ID_MATCH_DEVICE 2289 2289 | USB_DEVICE_ID_MATCH_INT_INFO,
+1 -1
drivers/media/usb/zr364xx/zr364xx.c
··· 93 93 94 94 /* Devices supported by this driver 95 95 * .driver_info contains the init method used by the camera */ 96 - static struct usb_device_id device_table[] = { 96 + static const struct usb_device_id device_table[] = { 97 97 {USB_DEVICE(0x08ca, 0x0109), .driver_info = METHOD0 }, 98 98 {USB_DEVICE(0x041e, 0x4024), .driver_info = METHOD0 }, 99 99 {USB_DEVICE(0x0d64, 0x0108), .driver_info = METHOD0 },