.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * CAN driver for PEAK System PCAN-USB Pro adapter |
---|
3 | 4 | * Derived from the PCAN project file driver/src/pcan_usbpro.c |
---|
4 | 5 | * |
---|
5 | 6 | * Copyright (C) 2003-2011 PEAK System-Technik GmbH |
---|
6 | 7 | * Copyright (C) 2011-2012 Stephane Grosjean <s.grosjean@peak-system.com> |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or modify it |
---|
9 | | - * under the terms of the GNU General Public License as published |
---|
10 | | - * by the Free Software Foundation; version 2 of the License. |
---|
11 | | - * |
---|
12 | | - * This program is distributed in the hope that it will be useful, but |
---|
13 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
15 | | - * General Public License for more details. |
---|
16 | 8 | */ |
---|
17 | 9 | #include <linux/netdevice.h> |
---|
18 | 10 | #include <linux/usb.h> |
---|
.. | .. |
---|
127 | 119 | /* |
---|
128 | 120 | * add one record to a message being built |
---|
129 | 121 | */ |
---|
130 | | -static int pcan_msg_add_rec(struct pcan_usb_pro_msg *pm, u8 id, ...) |
---|
| 122 | +static int pcan_msg_add_rec(struct pcan_usb_pro_msg *pm, int id, ...) |
---|
131 | 123 | { |
---|
132 | 124 | int len, i; |
---|
133 | 125 | u8 *pc; |
---|
.. | .. |
---|
141 | 133 | switch (id) { |
---|
142 | 134 | case PCAN_USBPRO_TXMSG8: |
---|
143 | 135 | i += 4; |
---|
144 | | - /* fall through */ |
---|
| 136 | + fallthrough; |
---|
145 | 137 | case PCAN_USBPRO_TXMSG4: |
---|
146 | 138 | i += 4; |
---|
147 | | - /* fall through */ |
---|
| 139 | + fallthrough; |
---|
148 | 140 | case PCAN_USBPRO_TXMSG0: |
---|
149 | 141 | *pc++ = va_arg(ap, int); |
---|
150 | 142 | *pc++ = va_arg(ap, int); |
---|
.. | .. |
---|
194 | 186 | |
---|
195 | 187 | len = pc - pm->rec_ptr; |
---|
196 | 188 | if (len > 0) { |
---|
197 | | - *pm->u.rec_cnt = cpu_to_le32(le32_to_cpu(*pm->u.rec_cnt) + 1); |
---|
| 189 | + le32_add_cpu(pm->u.rec_cnt, 1); |
---|
198 | 190 | *pm->rec_ptr = id; |
---|
199 | 191 | |
---|
200 | 192 | pm->rec_ptr = pc; |
---|
.. | .. |
---|
981 | 973 | struct usb_endpoint_descriptor *ep = &if_desc->endpoint[i].desc; |
---|
982 | 974 | |
---|
983 | 975 | /* |
---|
984 | | - * below is the list of valid ep addreses. Any other ep address |
---|
| 976 | + * below is the list of valid ep addresses. Any other ep address |
---|
985 | 977 | * is considered as not-CAN interface address => no dev created |
---|
986 | 978 | */ |
---|
987 | 979 | switch (ep->bEndpointAddress) { |
---|