hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/can/peak_canfd/peak_pciefd_main.c
....@@ -1,19 +1,10 @@
1
-/*
2
- * Copyright (C) 2007, 2011 Wolfgang Grandegger <wg@grandegger.com>
1
+// SPDX-License-Identifier: GPL-2.0-only
2
+/* Copyright (C) 2007, 2011 Wolfgang Grandegger <wg@grandegger.com>
33 * Copyright (C) 2012 Stephane Grosjean <s.grosjean@peak-system.com>
44 *
55 * Derived from the PCAN project file driver/src/pcan_pci.c:
66 *
77 * Copyright (C) 2001-2006 PEAK System-Technik GmbH
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the version 2 of the GNU General Public License
11
- * as published by the Free Software Foundation
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
178 */
189
1910 #include <linux/kernel.h>
....@@ -125,8 +116,6 @@
125116 #define CANFD_CTL_IRQ_CL_DEF 16 /* Rx msg max nb per IRQ in Rx DMA */
126117 #define CANFD_CTL_IRQ_TL_DEF 10 /* Time before IRQ if < CL (x100 µs) */
127118
128
-#define CANFD_OPTIONS_SET (CANFD_OPTION_ERROR | CANFD_OPTION_BUSLOAD)
129
-
130119 /* Tx anticipation window (link logical address should be aligned on 2K
131120 * boundary)
132121 */
....@@ -155,7 +144,7 @@
155144 __le32 irq_status;
156145 __le32 sys_time_low;
157146 __le32 sys_time_high;
158
- struct pucan_rx_msg msg[0];
147
+ struct pucan_rx_msg msg[];
159148 } __packed __aligned(4);
160149
161150 /* Tx Link record */
....@@ -203,7 +192,7 @@
203192 struct pci_dev *pci_dev;
204193 int can_count;
205194 spinlock_t cmd_lock; /* 64-bits cmds must be atomic */
206
- struct pciefd_can *can[0]; /* array of network devices */
195
+ struct pciefd_can *can[]; /* array of network devices */
207196 };
208197
209198 /* supported device ids. */
....@@ -668,7 +657,7 @@
668657 pciefd_can_writereg(priv, CANFD_CLK_SEL_80MHZ,
669658 PCIEFD_REG_CAN_CLK_SEL);
670659
671
- /* fallthough */
660
+ fallthrough;
672661 case CANFD_CLK_SEL_80MHZ:
673662 priv->ucan.can.clock.freq = 80 * 1000 * 1000;
674663 break;
....@@ -849,7 +838,8 @@
849838
850839 /* pci_xxx_config_word() return positive PCIBIOS_xxx error codes while
851840 * the probe() function must return a negative errno in case of failure
852
- * (err is unchanged if negative) */
841
+ * (err is unchanged if negative)
842
+ */
853843 return pcibios_err_to_errno(err);
854844 }
855845