Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1706701
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 03/35] can: peak_usb: constify usb_device_id |
| Date | 2017-08-08 18:00 +0200 |
| Message-ID | <ucf5h-258-41@gated-at.bofh.it> (permalink) |
| References | <ucf5g-258-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/net/can/usb/peak_usb/pcan_usb_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
index 1ca76e0..538be60 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
@@ -34,7 +34,7 @@ MODULE_DESCRIPTION("CAN driver for PEAK-System USB adapters");
MODULE_LICENSE("GPL v2");
/* Table of devices that work with this driver */
-static struct usb_device_id peak_usb_table[] = {
+static const struct usb_device_id peak_usb_table[] = {
{USB_DEVICE(PCAN_USB_VENDOR_ID, PCAN_USB_PRODUCT_ID)},
{USB_DEVICE(PCAN_USB_VENDOR_ID, PCAN_USBPRO_PRODUCT_ID)},
{USB_DEVICE(PCAN_USB_VENDOR_ID, PCAN_USBFD_PRODUCT_ID)},
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/35] constify net usb_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-08 18:00 +0200 [PATCH 03/35] can: peak_usb: constify usb_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-08 18:00 +0200 Re: [PATCH 00/35] constify net usb_device_id Kalle Valo <kvalo@codeaurora.org> - 2017-08-08 20:40 +0200 Re: [PATCH 00/35] constify net usb_device_id Marc Kleine-Budde <mkl@pengutronix.de> - 2017-08-10 13:10 +0200
csiph-web