Commit 2a27f6a
can: gs_usb: increase max interface to U8_MAX
This issue was found by Runcheng Lu when develop HSCanT USB to CAN FD
converter[1]. The original developers may have only 3 interfaces
device to test so they write 3 here and wait for future change.
During the HSCanT development, we actually used 4 interfaces, so the
limitation of 3 is not enough now. But just increase one is not
future-proofed. Since the channel index type in gs_host_frame is u8,
just make canch[] become a flexible array with a u8 index, so it
naturally constraint by U8_MAX and avoid statically allocate 256
pointer for every gs_usb device.
[1]: https://github.com/cherry-embedded/HSCanT-hardware
Fixes: d08e973 ("can: gs_usb: Added support for the GS_USB CAN devices")
Reported-by: Runcheng Lu <[email protected]>
Cc: [email protected]
Reviewed-by: Vincent Mailhol <[email protected]>
Signed-off-by: Celeste Liu <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Marc Kleine-Budde <[email protected]>1 parent 2c95a75 commit 2a27f6a
1 file changed
Lines changed: 10 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | 292 | | |
298 | 293 | | |
299 | 294 | | |
| |||
324 | 319 | | |
325 | 320 | | |
326 | 321 | | |
327 | | - | |
328 | 322 | | |
329 | 323 | | |
330 | 324 | | |
| |||
336 | 330 | | |
337 | 331 | | |
338 | 332 | | |
| 333 | + | |
339 | 334 | | |
340 | 335 | | |
341 | 336 | | |
| 337 | + | |
342 | 338 | | |
343 | 339 | | |
344 | 340 | | |
| |||
599 | 595 | | |
600 | 596 | | |
601 | 597 | | |
602 | | - | |
| 598 | + | |
603 | 599 | | |
604 | 600 | | |
605 | 601 | | |
| |||
699 | 695 | | |
700 | 696 | | |
701 | 697 | | |
702 | | - | |
| 698 | + | |
703 | 699 | | |
704 | 700 | | |
705 | 701 | | |
| |||
1460 | 1456 | | |
1461 | 1457 | | |
1462 | 1458 | | |
1463 | | - | |
| 1459 | + | |
1464 | 1460 | | |
1465 | 1461 | | |
1466 | | - | |
| 1462 | + | |
1467 | 1463 | | |
1468 | 1464 | | |
1469 | 1465 | | |
1470 | | - | |
| 1466 | + | |
1471 | 1467 | | |
1472 | 1468 | | |
1473 | 1469 | | |
| 1470 | + | |
| 1471 | + | |
1474 | 1472 | | |
1475 | 1473 | | |
1476 | 1474 | | |
| |||
1531 | 1529 | | |
1532 | 1530 | | |
1533 | 1531 | | |
1534 | | - | |
| 1532 | + | |
1535 | 1533 | | |
1536 | 1534 | | |
1537 | 1535 | | |
| |||
0 commit comments