Skip to contentSkip to conversation

CAN bus support for QEMU (SJA1000 PCI so far)

PATCH In review [email protected] 2 participants 9 messages Jan 5, 2017 – Jan 6, 2017

lore
Share & tools
lore
#0 lore raw

cover CAN bus support for QEMU (SJA1000 PCI so far)

From: Pavel Pisa <[email protected]>

Hello Stefan and others,

I have found some time over holidays. I have rebased patches and checked that the CAN bus emulation works with QEMU-2.8 release.

The work has been started by Jin Yang in the frame of GSoC 2013 slot contributed by RTEMS project which has been looking for environment to allow develope and test CAN drivers for multiple CPU rachitectures.

I have menthored the project and then done substantial code cleanup and update to QOM. Deniz Eren then used emulation for SJA1000 base card driver development for other operating system and contributed PCM-3680I support.

Some page about the project

https://rtime.felk.cvut.cz/can/can-qemu/

RTLWS 2015 article

http://rtime.felk.cvut.cz/publications/public/rtlws2015-qemu-can.pdf

and slides

http://rtime.felk.cvut.cz/publications/public/rtlws2015-qemu-can-slides.pdf

GitHub repository with can-pci branch for 2.3, 2.4, 2.7 and 2.8 version if QEMU is available there

https://github.com/CTU-IIG/qemu

There are more unsolved things in the code still (for example freeze and migration would not work. CAN controllers use proper QOM model but bus/interconnection emulation uses simple broadcast connection which is required for CAN, but it is not based on QEMU bus model).

CAN-FD support would be interesting but it is missing and there is almost zero chance that I find spare time to start such work without more people contribute and or funded project at university which would allow to seek between my colleagues for cooperation.

But I believe that (even in its actual state) provided solution is great help for embedded systems developers when they can connect SocketCAN from one or more embedded systems running in virtual environment together or with Linux host SocketCAN virtual or real bus interfaces.

We have even tested our generic CANopen device configured for CANopen 401 profile for generic I/O running in the virtual system which can control GPIO inputs/outputs through virtual industrial I/O card. This industrial I/O card support would worth to be included in QEMU mainline as well but it would require even more effort to get it into mainline acceptable state then this CAN support even that we have mainlined UIO and Comedi drivers for that this card hardware to Linux mainline long time ago.

Generally QEMU can be interesting setup which allows to test complete industrial applications in virtual environment even before real hardware is availabe.

Best wishes and sucesfull year 2017,

Pavel

Deniz Eren (4):
CAN bus PCM-3680I PCI (dual SJA1000 channel) emulation added. Fixed IRQ problem for CAN device can_pcm3680_pci. Minor clean-up of can_pcm3680_pci.
CAN bus MIOe-3680 PCI (dual SJA1000 channel) emulation added.

Pavel Pisa (2):
CAN bus simple SJA1000 PCI card emulation for QEMU
CAN bus Kvaser PCI CAN-S (single SJA1000 channel) emulation added.

 default-configs/pci.mak   |   2 +
 hw/Makefile.objs          |   1 +
 hw/can/Makefile.objs      |   8 +
 hw/can/can_core.c         | 349 +++++++++++++++++
 hw/can/can_kvaser_pci.c   | 364 ++++++++++++++++++
 hw/can/can_mioe3680_pci.c | 325 ++++++++++++++++
 hw/can/can_pci.c          | 239 ++++++++++++
 hw/can/can_pcm3680_pci.c  | 325 ++++++++++++++++
 hw/can/can_sja1000.c      | 943 ++++++++++++++++++++++++++++++++++++++++++++++
 hw/can/can_sja1000.h      | 163 ++++++++
 include/can/can_emu.h     | 123 ++++++
 11 files changed, 2842 insertions(+)
 create mode 100644 hw/can/Makefile.objs
 create mode 100644 hw/can/can_core.c
 create mode 100644 hw/can/can_kvaser_pci.c
 create mode 100644 hw/can/can_mioe3680_pci.c
 create mode 100644 hw/can/can_pci.c
 create mode 100644 hw/can/can_pcm3680_pci.c
 create mode 100644 hw/can/can_sja1000.c
 create mode 100644 hw/can/can_sja1000.h
 create mode 100644 include/can/can_emu.h
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/6 CAN bus simple SJA1000 PCI card emulation for QEMU

From: Pavel Pisa <[email protected]>

The work is based on Jin Yang GSoC 2013 work funded by Google and mentored in frame of RTEMS project GSoC slot donated to QEMU.

Rewritten for QEMU-2.0+ versions and architecture cleanup by Pavel Pisa (Czech Technical University in Prague).

The core SJA1000 support is independent of provided PCI board. The simple core CAN bus infrastructure is independent as well.

Connection to the real host CAN bus network through SocketCAN network interface is available for Linux host system as well.

---
 default-configs/pci.mak |   2 +
 hw/Makefile.objs        |   1 +
 hw/can/Makefile.objs    |   5 +
 hw/can/can_core.c       | 349 ++++++++++++++++++
 hw/can/can_pci.c        | 239 ++++++++++++
 hw/can/can_sja1000.c    | 943 ++++++++++++++++++++++++++++++++++++++++++++++++
 hw/can/can_sja1000.h    | 163 +++++++++
 include/can/can_emu.h   | 123 +++++++
 8 files changed, 1825 insertions(+)
 create mode 100644 hw/can/Makefile.objs
 create mode 100644 hw/can/can_core.c
 create mode 100644 hw/can/can_pci.c
 create mode 100644 hw/can/can_sja1000.c
 create mode 100644 hw/can/can_sja1000.h
 create mode 100644 include/can/can_emu.h
default-configs/pci.mak +2 -0
index fff7ce3..347c1bc 100644
@@ -28,6 +28,8 @@ CONFIG_ESP=y
 CONFIG_ESP_PCI=y
 CONFIG_SERIAL=y
 CONFIG_SERIAL_PCI=y
+CONFIG_CAN_SJA1000=y
+CONFIG_CAN_PCI=y
 CONFIG_IPACK=y
 CONFIG_WDT_IB6300ESB=y
 CONFIG_PCI_TESTDEV=y
hw/Makefile.objs +1 -0
index 0ffd281..8a249de 100644
@@ -6,6 +6,7 @@ devices-dirs-$(CONFIG_SOFTMMU) += block/
 devices-dirs-$(CONFIG_SOFTMMU) += bt/
 devices-dirs-$(CONFIG_SOFTMMU) += char/
 devices-dirs-$(CONFIG_SOFTMMU) += cpu/
+devices-dirs-$(CONFIG_SOFTMMU) += can/
 devices-dirs-$(CONFIG_SOFTMMU) += display/
 devices-dirs-$(CONFIG_SOFTMMU) += dma/
 devices-dirs-$(CONFIG_SOFTMMU) += gpio/
hw/can/Makefile.objs new file +5 -0
new file mode 100644
index 0000000..98ff1e3
@@ -0,0 +1,5 @@
+# CAN bus interfaces emulation and infrastructure
+
+common-obj-$(CONFIG_CAN_SJA1000) += can_core.o
+common-obj-$(CONFIG_CAN_SJA1000) += can_sja1000.o
+common-obj-$(CONFIG_CAN_PCI) += can_pci.o
hw/can/can_core.c new file +349 -0

349 lines not on this page · raw message

hw/can/can_pci.c new file +239 -0

239 lines not on this page · raw message

hw/can/can_sja1000.c new file +943 -0

943 lines not on this page · raw message

hw/can/can_sja1000.h new file +163 -0

163 lines not on this page · raw message

include/can/can_emu.h new file +123 -0

123 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/6 CAN bus Kvaser PCI CAN-S (single SJA1000 channel) emulation added.

In reply to [email protected]

From: Pavel Pisa <[email protected]>

---
 hw/can/Makefile.objs    |   1 +
 hw/can/can_kvaser_pci.c | 364 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 365 insertions(+)
 create mode 100644 hw/can/can_kvaser_pci.c
hw/can/Makefile.objs +1 -0
index 98ff1e3..560bb1b 100644
@@ -3,3 +3,4 @@
 common-obj-$(CONFIG_CAN_SJA1000) += can_core.o
 common-obj-$(CONFIG_CAN_SJA1000) += can_sja1000.o
 common-obj-$(CONFIG_CAN_PCI) += can_pci.o
+common-obj-$(CONFIG_CAN_PCI) += can_kvaser_pci.o
hw/can/can_kvaser_pci.c new file +364 -0

364 lines not on this page · raw message

Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/6 CAN bus PCM-3680I PCI (dual SJA1000 channel) emulation added.

In reply to [email protected]

From: Deniz Eren <[email protected]>

---
 hw/can/Makefile.objs     |   1 +
 hw/can/can_pcm3680_pci.c | 315 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 316 insertions(+)
 create mode 100644 hw/can/can_pcm3680_pci.c
hw/can/Makefile.objs +1 -0
index 560bb1b..d654ca3 100644
@@ -4,3 +4,4 @@ common-obj-$(CONFIG_CAN_SJA1000) += can_core.o
 common-obj-$(CONFIG_CAN_SJA1000) += can_sja1000.o
 common-obj-$(CONFIG_CAN_PCI) += can_pci.o
 common-obj-$(CONFIG_CAN_PCI) += can_kvaser_pci.o
+common-obj-$(CONFIG_CAN_PCI) += can_pcm3680_pci.o
hw/can/can_pcm3680_pci.c new file +315 -0

315 lines not on this page · raw message

Signature · 1 line
1.9.1
#4 lore raw

PATCH 4/6 Fixed IRQ problem for CAN device can_pcm3680_pci.

In reply to [email protected]

From: Deniz Eren <[email protected]>

---
 hw/can/can_pcm3680_pci.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
hw/can/can_pcm3680_pci.c +11 -0
index 6e5c9f2..9d8d3f7 100644
@@ -61,6 +61,7 @@ typedef struct Pcm3680iPCIState {
     MemoryRegion    sja_io[2];
 
     CanSJA1000State sja_state[2];
+    qemu_irq        irq;
 
     char            *model; /* The model that support, only SJA1000 now. */
     char            *canbus[2];
@@ -69,10 +70,16 @@ typedef struct Pcm3680iPCIState {
 
 static void pcm3680i_pci_irq_raise(void *opaque)
 {
+    Pcm3680iPCIState *d = (Pcm3680iPCIState *)opaque;
+
+    qemu_irq_raise(d->irq);
 }
 
 static void pcm3680i_pci_irq_lower(void *opaque)
 {
+    Pcm3680iPCIState *d = (Pcm3680iPCIState *)opaque;
+
+    qemu_irq_lower(d->irq);
 }
 
 static void
@@ -202,6 +209,8 @@ static int pcm3680i_pci_init(PCIDevice *pci_dev)
     pci_conf = pci_dev->config;
     pci_conf[PCI_INTERRUPT_PIN] = 0x01; /* interrupt pin A */
 
+    d->irq = pci_allocate_irq(&d->dev);
+
     can_sja_init(s1, pcm3680i_pci_irq_raise, pcm3680i_pci_irq_lower, d);
     can_sja_init(s2, pcm3680i_pci_irq_raise, pcm3680i_pci_irq_lower, d);
 
@@ -248,6 +257,8 @@ static void pcm3680i_pci_exit(PCIDevice *pci_dev)
 
     can_sja_exit(s1);
     can_sja_exit(s2);
+
+    qemu_free_irq(d->irq);
 }
 
 static const VMStateDescription vmstate_pcm3680i_pci = {
Signature · 1 line
1.9.1
#5 lore raw

PATCH 5/6 Minor clean-up of can_pcm3680_pci.

In reply to [email protected]

From: Deniz Eren <[email protected]>

---
 hw/can/can_pcm3680_pci.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
hw/can/can_pcm3680_pci.c +3 -4
index 9d8d3f7..1134960 100644
@@ -249,8 +249,7 @@ static void pcm3680i_pci_exit(PCIDevice *pci_dev)
     qemu_unregister_reset(pcm3680i_pci_reset, d);
 
     /*
-     * regions d->s5920_io, d->sja_io and d->xilinx_io
-     * are destroyed by QOM now
+     * region d->sja_io is destroyed by QOM now
      */
     /* memory_region_destroy(&d->sja_io[0]); */
     /* memory_region_destroy(&d->sja_io[1]); */
@@ -300,8 +299,8 @@ static void pcm3680i_pci_class_init(ObjectClass *klass, void *data)
     k->device_id = PCM3680i_PCI_DEVICE_ID1;
     k->revision = 0x00;
     k->class_id = 0x000c09;
-    k->subsystem_vendor_id = 0x13fe;
-    k->subsystem_id = 0xc002;
+    k->subsystem_vendor_id = PCM3680i_PCI_VENDOR_ID1;
+    k->subsystem_id = PCM3680i_PCI_DEVICE_ID1;
 //  k->is_bridge = 0;
 //  k->is_express = 0;
     dc->desc = "Pcm3680i PCICANx";
Signature · 1 line
1.9.1
#6 lore raw

PATCH 6/6 CAN bus MIOe-3680 PCI (dual SJA1000 channel) emulation added.

In reply to [email protected]

From: Deniz Eren <[email protected]>

---
 hw/can/Makefile.objs      |   1 +
 hw/can/can_mioe3680_pci.c | 325 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 326 insertions(+)
 create mode 100644 hw/can/can_mioe3680_pci.c
hw/can/Makefile.objs +1 -0
index d654ca3..36930bc 100644
@@ -5,3 +5,4 @@ common-obj-$(CONFIG_CAN_SJA1000) += can_sja1000.o
 common-obj-$(CONFIG_CAN_PCI) += can_pci.o
 common-obj-$(CONFIG_CAN_PCI) += can_kvaser_pci.o
 common-obj-$(CONFIG_CAN_PCI) += can_pcm3680_pci.o
+common-obj-$(CONFIG_CAN_PCI) += can_mioe3680_pci.o
hw/can/can_mioe3680_pci.c new file +325 -0

325 lines not on this page · raw message

Signature · 1 line
1.9.1
#7 lore raw
In reply to [email protected]
Your series seems to have some coding style problems. See output below for more information:

Hi,

Your series seems to have some coding style problems. See output below for more information:

Message-id: [email protected]
Subject: [Qemu-devel] [PATCH 0/6] CAN bus support for QEMU (SJA1000 PCI so far)
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

# Useful git options
git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)" for c in $commits; do

    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))

done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
* [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
e262272 CAN bus MIOe-3680 PCI (dual SJA1000 channel) emulation added. 4c15cb0 Minor clean-up of can_pcm3680_pci.
e30986a Fixed IRQ problem for CAN device can_pcm3680_pci. aa7b853 CAN bus PCM-3680I PCI (dual SJA1000 channel) emulation added. d264f8a CAN bus Kvaser PCI CAN-S (single SJA1000 channel) emulation added. 4e0a159 CAN bus simple SJA1000 PCI card emulation for QEMU

=== OUTPUT BEGIN ===
Checking PATCH 1/6: CAN bus simple SJA1000 PCI card emulation for QEMU...
WARNING: architecture specific defines should be avoided
#99: FILE: hw/can/can_core.c:34:
+#ifdef __linux__

WARNING: line over 80 characters
#121: FILE: hw/can/can_core.c:56:
+static QTAILQ_HEAD(, CanBusState) can_buses = QTAILQ_HEAD_INITIALIZER(can_buses);

WARNING: architecture specific defines should be avoided #217: FILE: hw/can/can_core.c:152:
+#ifdef __linux__

WARNING: line over 80 characters
#239: FILE: hw/can/can_core.c:174:
+ CanBusHostConnectState *c = container_of(client, CanBusHostConnectState, bus_client);

WARNING: line over 80 characters
#251: FILE: hw/can/can_core.c:186:
+ CanBusHostConnectState *c = container_of(client, CanBusHostConnectState, bus_client);

WARNING: line over 80 characters
#277: FILE: hw/can/can_core.c:212:
+ CanBusHostConnectState *c = container_of(client, CanBusHostConnectState, bus_client);

ERROR: line over 90 characters
#286: FILE: hw/can/can_core.c:221:
+int can_bus_host_set_filters(CanBusClientState *, const struct qemu_can_filter *filters, size_t filters_cnt);

ERROR: externs should be avoided in .c files
#286: FILE: hw/can/can_core.c:221:
+int can_bus_host_set_filters(CanBusClientState *, const struct qemu_can_filter *filters, size_t filters_cnt);

ERROR: line over 90 characters
#288: FILE: hw/can/can_core.c:223:
+int can_bus_host_set_filters(CanBusClientState *client, const struct qemu_can_filter *filters, size_t filters_cnt)

WARNING: line over 80 characters
#290: FILE: hw/can/can_core.c:225:
+ CanBusHostConnectState *c = container_of(client, CanBusHostConnectState, bus_client);

ERROR: line over 90 characters
#302: FILE: hw/can/can_core.c:237:
+ printf("[%i] id=0x%08x maks=0x%08x\n", i, filters[i].can_id, filters[i].can_mask);

WARNING: line over 80 characters
#361: FILE: hw/can/can_core.c:296:
+ c->rfilter[0].can_id = 0; /* Receive all data frame. If |= CAN_INV_FILTER no data. */

ERROR: Error messages should not contain newlines
#394: FILE: hw/can/can_core.c:329:
+ error_report("CAN bus setup of host connect to \"%s\" failed\n",

ERROR: Error messages should not contain newlines
#400: FILE: hw/can/can_core.c:335:
+ error_report("CAN host device \"%s\" connect to bus \"%s\" failed\n",

WARNING: line over 80 characters
#411: FILE: hw/can/can_core.c:346:
+ error_report("CAN bus connect to host device not supported on this system\n");

ERROR: Error messages should not contain newlines
#411: FILE: hw/can/can_core.c:346:
+ error_report("CAN bus connect to host device not supported on this system\n");

ERROR: Error messages should not contain newlines
#545: FILE: hw/can/can_pci.c:125:
+ "the model %s is not supported now.\n", d->model);

ERROR: Error messages should not contain newlines
#552: FILE: hw/can/can_pci.c:132:
+ error_report("Cannot create can find/allocate CAN bus\n");

WARNING: line over 80 characters
#559: FILE: hw/can/can_pci.c:139:
+ error_report("Cannot connect CAN bus to host device \"%s\"\n", d->host);

ERROR: Error messages should not contain newlines
#559: FILE: hw/can/can_pci.c:139:
+ error_report("Cannot connect CAN bus to host device \"%s\"\n", d->host);

ERROR: Error messages should not contain newlines
#574: FILE: hw/can/can_pci.c:154:
+ error_report("can_sja_connect_to_bus failed\n");

WARNING: line over 80 characters
#581: FILE: hw/can/can_pci.c:161:
+ pci_register_bar(pci_dev, /*BAR*/ 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &d->sja_mmio);

WARNING: line over 80 characters
#610: FILE: hw/can/can_pci.c:190:
+ VMSTATE_STRUCT(sja_state, CanPCIState, 0, vmstate_can_sja, CanSJA1000State),

ERROR: do not use C99 // comments
#699: FILE: hw/can/can_sja1000.c:34:
+//#define DEBUG_FILTER

WARNING: line over 80 characters
#733: FILE: hw/can/can_sja1000.c:68:
+static int can_sja_accept_filter(CanSJA1000State *s, const qemu_can_frame *frame)

ERROR: spaces required around that '+' (ctx:VxV)
#831: FILE: hw/can/can_sja1000.c:166:

+            frame->data[i] = buff[5+i];
                                    ^

ERROR: spaces required around that '+' (ctx:VxV)
#840: FILE: hw/can/can_sja1000.c:175:

+            frame->data[i] = buff[3+i];
                                    ^

ERROR: spaces required around that '+' (ctx:VxV)
#860: FILE: hw/can/can_sja1000.c:195:

+        frame->data[i] = buff[2+i];
                                ^

WARNING: line over 80 characters
#893: FILE: hw/can/can_sja1000.c:228:
+ buff[++count] = (frame->can_id << 05) & 0xe0; /* ID.02~ID.00,x,x,x,x,x */

WARNING: line over 80 characters
#936: FILE: hw/can/can_sja1000.c:271:
+void can_sja_mem_write(CanSJA1000State *s, hwaddr addr, uint64_t val, unsigned size)

WARNING: line over 80 characters
#943: FILE: hw/can/can_sja1000.c:278:
+ DPRINTF("write 0x%02llx addr 0x%02x\n", (unsigned long long)val, (unsigned int)addr);

WARNING: line over 80 characters
#1068: FILE: hw/can/can_sja1000.c:403:
+ s->statusP &= ~(3 << 2); /* Clear transmission complete status, */

WARNING: line over 80 characters
#1171: FILE: hw/can/can_sja1000.c:506:
+ s->statusB &= ~(3 << 2); /* Clear transmission complete status, */

WARNING: line over 80 characters
#1193: FILE: hw/can/can_sja1000.c:528:
+ printf(" %02X", s->rx_buff[(s->rxbuf_start + i) % SJA_RCV_BUF_LEN]);

WARNING: line over 80 characters
#1287: FILE: hw/can/can_sja1000.c:622:
+ case 8: /* Output control register, hardware related, not support now. */

WARNING: line over 80 characters
#1318: FILE: hw/can/can_sja1000.c:653:
+ temp = s->rx_buff[(s->rxbuf_start + addr - 16) % SJA_RCV_BUF_LEN];

ERROR: line over 90 characters
#1376: FILE: hw/can/can_sja1000.c:711:
+ DPRINTF(" %d bytes of 0x%lx from addr %d\n", size, (long unsigned int)temp, (int)addr);

ERROR: line over 90 characters
#1398: FILE: hw/can/can_sja1000.c:733:
+ssize_t can_sja_receive(CanBusClientState *client, const qemu_can_frame *frames, size_t frames_cnt)

ERROR: line over 90 characters
#1493: FILE: hw/can/can_sja1000.c:828:
+ printf("RCV B ret=%2d, ptr=%2d cnt=%2d msg=%2d\n", ret, s->rx_ptr, s->rx_cnt, s->rxmsg_cnt);

ERROR: do not use C99 // comments
#1653: FILE: hw/can/can_sja1000.h:39:
+//#define DEBUG_CAN

WARNING: line over 80 characters
#1670: FILE: hw/can/can_sja1000.h:56:
+ uint8_t interrupt_en; /* PeliCAN, addr 4, Interrupt Enable register */

WARNING: line over 80 characters
#1671: FILE: hw/can/can_sja1000.h:57:
+ uint8_t rxmsg_cnt; /* PeliCAN, addr 29, RX message counter. DS-p49 */

ERROR: line over 90 characters
#1672: FILE: hw/can/can_sja1000.h:58:
+ uint8_t rxbuf_start; /* PeliCAN, addr 30, RX buffer start address register, DS-p49 */

WARNING: line over 80 characters
#1673: FILE: hw/can/can_sja1000.h:59:
+ uint8_t clock; /* PeliCAN, addr 31, Clock Divider register, DS-p55 */

WARNING: line over 80 characters
#1687: FILE: hw/can/can_sja1000.h:73:
+ uint8_t code; /* BasicCAN, addr 4, Acceptance code register */

WARNING: line over 80 characters
#1688: FILE: hw/can/can_sja1000.h:74:
+ uint8_t mask; /* BasicCAN, addr 5, Acceptance mask register */

WARNING: line over 80 characters
#1733: FILE: hw/can/can_sja1000.h:119:
+/* ID bytes (11 bits in 0 and 1 or 16 bits in 0,1 and 13 bits in 2,3 (extended)) */

WARNING: line over 80 characters
#1764: FILE: hw/can/can_sja1000.h:150:
+void can_sja_mem_write(CanSJA1000State *s, hwaddr addr, uint64_t val, unsigned size);

ERROR: line over 90 characters
#1773: FILE: hw/can/can_sja1000.h:159:
+ssize_t can_sja_receive(CanBusClientState *client, const qemu_can_frame *frames, size_t frames_cnt);

WARNING: architecture specific defines should be avoided #1828: FILE: include/can/can_emu.h:45:
+#if defined(__GNUC__) || defined(__linux__)

ERROR: line over 90 characters
#1865: FILE: include/can/can_emu.h:82:
+typedef ssize_t (CanBusClientReceive)(CanBusClientState *, const struct qemu_can_frame *frames, size_t frames_cnt);

ERROR: line over 90 characters
#1902: FILE: include/can/can_emu.h:119:
+ssize_t can_bus_client_send(CanBusClientState *, const struct qemu_can_frame *frames, size_t frames_cnt);

ERROR: line over 90 characters
#1903: FILE: include/can/can_emu.h:120:
+int can_bus_client_set_filters(CanBusClientState *, const struct qemu_can_filter *filters, size_t filters_cnt);

total: 24 errors, 29 warnings, 1837 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 2/6: CAN bus Kvaser PCI CAN-S (single SJA1000 channel) emulation added....
ERROR: braces {} are necessary for all arms of this statement
#124: FILE: hw/can/can_kvaser_pci.c:100:
+ if (d->s5920_intcsr & S5920_INTCSR_ADDON_INTENABLE_M)
[...]

WARNING: line over 80 characters
#144: FILE: hw/can/can_kvaser_pci.c:120:
+static uint64_t kvaser_pci_s5920_io_read(void *opaque, hwaddr addr, unsigned size)

WARNING: line over 80 characters
#203: FILE: hw/can/can_kvaser_pci.c:179:
+static uint64_t kvaser_pci_xilinx_io_read(void *opaque, hwaddr addr, unsigned size)

ERROR: Error messages should not contain newlines
#261: FILE: hw/can/can_kvaser_pci.c:237:
+ "the model %s is not supported now.\n", d->model);

ERROR: Error messages should not contain newlines
#268: FILE: hw/can/can_kvaser_pci.c:244:
+ error_report("Cannot create can find/allocate CAN bus\n");

WARNING: line over 80 characters
#275: FILE: hw/can/can_kvaser_pci.c:251:
+ error_report("Cannot connect CAN bus to host device \"%s\"\n", d->host);

ERROR: Error messages should not contain newlines
#275: FILE: hw/can/can_kvaser_pci.c:251:
+ error_report("Cannot connect CAN bus to host device \"%s\"\n", d->host);

ERROR: Error messages should not contain newlines
#290: FILE: hw/can/can_kvaser_pci.c:266:
+ error_report("can_sja_connect_to_bus failed\n");

WARNING: line over 80 characters
#298: FILE: hw/can/can_kvaser_pci.c:274:
+ memory_region_init_io(&d->xilinx_io, OBJECT(d), &kvaser_pci_xilinx_io_ops, d,

WARNING: line over 80 characters
#301: FILE: hw/can/can_kvaser_pci.c:277:
+ pci_register_bar(&d->dev, /*BAR*/ 0, PCI_BASE_ADDRESS_SPACE_IO, &d->s5920_io);

WARNING: line over 80 characters
#303: FILE: hw/can/can_kvaser_pci.c:279:
+ pci_register_bar(&d->dev, /*BAR*/ 2, PCI_BASE_ADDRESS_SPACE_IO, &d->xilinx_io);

WARNING: line over 80 characters
#337: FILE: hw/can/can_kvaser_pci.c:313:
+ VMSTATE_STRUCT(sja_state, KvaserPCIState, 0, vmstate_can_sja, CanSJA1000State),

total: 5 errors, 7 warnings, 368 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 3/6: CAN bus PCM-3680I PCI (dual SJA1000 channel) emulation added....
WARNING: line over 80 characters
#68: FILE: hw/can/can_pcm3680_pci.c:46:
+#define PCM3680i_PCI_VENDOR_ID1 0x13fe /* the PCI device and vendor IDs */

WARNING: line over 80 characters
#111: FILE: hw/can/can_pcm3680_pci.c:89:
+static uint64_t pcm3680i_pci_sja1_io_read(void *opaque, hwaddr addr, unsigned size)

WARNING: line over 80 characters
#136: FILE: hw/can/can_pcm3680_pci.c:114:
+static uint64_t pcm3680i_pci_sja2_io_read(void *opaque, hwaddr addr, unsigned size)

ERROR: Error messages should not contain newlines
#193: FILE: hw/can/can_pcm3680_pci.c:171:
+ "the model %s is not supported now.\n", d->model);

ERROR: Error messages should not contain newlines
#200: FILE: hw/can/can_pcm3680_pci.c:178:
+ error_report("Cannot create can find/allocate CAN bus #1\n");

ERROR: Error messages should not contain newlines
#206: FILE: hw/can/can_pcm3680_pci.c:184:
+ error_report("Cannot create can find/allocate CAN bus #2\n");

WARNING: line over 80 characters
#212: FILE: hw/can/can_pcm3680_pci.c:190:
+ error_report("Cannot connect CAN bus to host #1 device \"%s\"\n", d->host[0]);

ERROR: Error messages should not contain newlines
#212: FILE: hw/can/can_pcm3680_pci.c:190:
+ error_report("Cannot connect CAN bus to host #1 device \"%s\"\n", d->host[0]);

WARNING: line over 80 characters
#219: FILE: hw/can/can_pcm3680_pci.c:197:
+ error_report("Cannot connect CAN bus to host #2 device \"%s\"\n", d->host[1]);

ERROR: Error messages should not contain newlines
#219: FILE: hw/can/can_pcm3680_pci.c:197:
+ error_report("Cannot connect CAN bus to host #2 device \"%s\"\n", d->host[1]);

ERROR: Error messages should not contain newlines
#233: FILE: hw/can/can_pcm3680_pci.c:211:
+ error_report("can_sja_connect_to_bus failed\n");

ERROR: Error messages should not contain newlines
#238: FILE: hw/can/can_pcm3680_pci.c:216:
+ error_report("can_sja_connect_to_bus failed\n");

WARNING: line over 80 characters
#242: FILE: hw/can/can_pcm3680_pci.c:220:
+ memory_region_init_io(&d->sja_io[0], OBJECT(d), &pcm3680i_pci_sja1_io_ops, d,

ERROR: spaces required around that '/' (ctx:VxV)
#243: FILE: hw/can/can_pcm3680_pci.c:221:

+                          "pcm3680i_pci-sja1", PCM3680i_PCI_SJA_RANGE/2);
                                                                      ^

WARNING: line over 80 characters
#244: FILE: hw/can/can_pcm3680_pci.c:222:
+ memory_region_init_io(&d->sja_io[1], OBJECT(d), &pcm3680i_pci_sja2_io_ops, d,

ERROR: spaces required around that '/' (ctx:VxV)
#245: FILE: hw/can/can_pcm3680_pci.c:223:

+                          "pcm3680i_pci-sja2", PCM3680i_PCI_SJA_RANGE/2);
                                                                      ^

WARNING: line over 80 characters
#247: FILE: hw/can/can_pcm3680_pci.c:225:
+ pci_register_bar(&d->dev, /*BAR*/ 0, PCI_BASE_ADDRESS_SPACE_IO, &d->sja_io[0]);

WARNING: line over 80 characters
#248: FILE: hw/can/can_pcm3680_pci.c:226:
+ pci_register_bar(&d->dev, /*BAR*/ 1, PCI_BASE_ADDRESS_SPACE_IO, &d->sja_io[1]);

ERROR: line over 90 characters
#282: FILE: hw/can/can_pcm3680_pci.c:260:
+ VMSTATE_STRUCT(sja_state[0], Pcm3680iPCIState, 0, vmstate_can_sja, CanSJA1000State),

ERROR: line over 90 characters
#283: FILE: hw/can/can_pcm3680_pci.c:261:
+ VMSTATE_STRUCT(sja_state[1], Pcm3680iPCIState, 0, vmstate_can_sja, CanSJA1000State),

ERROR: do not use C99 // comments
#316: FILE: hw/can/can_pcm3680_pci.c:294:
+// k->is_bridge = 0;

ERROR: do not use C99 // comments
#317: FILE: hw/can/can_pcm3680_pci.c:295:
+// k->is_express = 0;

ERROR: Missing Signed-off-by: line(s)

total: 14 errors, 9 warnings, 319 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 4/6: Fixed IRQ problem for CAN device can_pcm3680_pci.... Checking PATCH 5/6: Minor clean-up of can_pcm3680_pci....
Checking PATCH 6/6: CAN bus MIOe-3680 PCI (dual SJA1000 channel) emulation added....
WARNING: line over 80 characters
#68: FILE: hw/can/can_mioe3680_pci.c:46:
+#define MIOe3680_PCI_VENDOR_ID1 0x13fe /* the PCI device and vendor IDs */

WARNING: line over 80 characters
#118: FILE: hw/can/can_mioe3680_pci.c:96:
+static uint64_t mioe3680_pci_sja1_io_read(void *opaque, hwaddr addr, unsigned size)

WARNING: line over 80 characters
#143: FILE: hw/can/can_mioe3680_pci.c:121:
+static uint64_t mioe3680_pci_sja2_io_read(void *opaque, hwaddr addr, unsigned size)

ERROR: Error messages should not contain newlines
#200: FILE: hw/can/can_mioe3680_pci.c:178:
+ "the model %s is not supported now.\n", d->model);

ERROR: Error messages should not contain newlines
#207: FILE: hw/can/can_mioe3680_pci.c:185:
+ error_report("Cannot create can find/allocate CAN bus #1\n");

ERROR: Error messages should not contain newlines
#213: FILE: hw/can/can_mioe3680_pci.c:191:
+ error_report("Cannot create can find/allocate CAN bus #2\n");

WARNING: line over 80 characters
#219: FILE: hw/can/can_mioe3680_pci.c:197:
+ error_report("Cannot connect CAN bus to host #1 device \"%s\"\n", d->host[0]);

ERROR: Error messages should not contain newlines
#219: FILE: hw/can/can_mioe3680_pci.c:197:
+ error_report("Cannot connect CAN bus to host #1 device \"%s\"\n", d->host[0]);

WARNING: line over 80 characters
#226: FILE: hw/can/can_mioe3680_pci.c:204:
+ error_report("Cannot connect CAN bus to host #2 device \"%s\"\n", d->host[1]);

ERROR: Error messages should not contain newlines
#226: FILE: hw/can/can_mioe3680_pci.c:204:
+ error_report("Cannot connect CAN bus to host #2 device \"%s\"\n", d->host[1]);

ERROR: Error messages should not contain newlines
#242: FILE: hw/can/can_mioe3680_pci.c:220:
+ error_report("can_sja_connect_to_bus failed\n");

ERROR: Error messages should not contain newlines
#247: FILE: hw/can/can_mioe3680_pci.c:225:
+ error_report("can_sja_connect_to_bus failed\n");

WARNING: line over 80 characters
#251: FILE: hw/can/can_mioe3680_pci.c:229:
+ memory_region_init_io(&d->sja_io[0], OBJECT(d), &mioe3680_pci_sja1_io_ops, d,

ERROR: spaces required around that '/' (ctx:VxV)
#252: FILE: hw/can/can_mioe3680_pci.c:230:

+                          "mioe3680_pci-sja1", MIOe3680_PCI_SJA_RANGE/2);
                                                                      ^

WARNING: line over 80 characters
#253: FILE: hw/can/can_mioe3680_pci.c:231:
+ memory_region_init_io(&d->sja_io[1], OBJECT(d), &mioe3680_pci_sja2_io_ops, d,

ERROR: spaces required around that '/' (ctx:VxV)
#254: FILE: hw/can/can_mioe3680_pci.c:232:

+                          "mioe3680_pci-sja2", MIOe3680_PCI_SJA_RANGE/2);
                                                                      ^

WARNING: line over 80 characters
#256: FILE: hw/can/can_mioe3680_pci.c:234:
+ pci_register_bar(&d->dev, /*BAR*/ 0, PCI_BASE_ADDRESS_SPACE_IO, &d->sja_io[0]);

WARNING: line over 80 characters
#257: FILE: hw/can/can_mioe3680_pci.c:235:
+ pci_register_bar(&d->dev, /*BAR*/ 1, PCI_BASE_ADDRESS_SPACE_IO, &d->sja_io[1]);

ERROR: line over 90 characters
#292: FILE: hw/can/can_mioe3680_pci.c:270:
+ VMSTATE_STRUCT(sja_state[0], Mioe3680PCIState, 0, vmstate_can_sja, CanSJA1000State),

ERROR: line over 90 characters
#293: FILE: hw/can/can_mioe3680_pci.c:271:
+ VMSTATE_STRUCT(sja_state[1], Mioe3680PCIState, 0, vmstate_can_sja, CanSJA1000State),

ERROR: do not use C99 // comments
#326: FILE: hw/can/can_mioe3680_pci.c:304:
+// k->is_bridge = 0;

ERROR: do not use C99 // comments
#327: FILE: hw/can/can_mioe3680_pci.c:305:
+// k->is_express = 0;

ERROR: Missing Signed-off-by: line(s)

total: 14 errors, 9 warnings, 329 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1

---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]

author
#8 lore raw

Hello all,

Quoted 8 lines · On Friday 06 of January 2017 00:22:28 [email protected] wrote:

Hi,

Your series seems to have some coding style problems. See output below for more information:

Message-id: [email protected]
Subject: [Qemu-devel] [PATCH 0/6] CAN bus support for QEMU (SJA1000 PCI so far) Type: series

I have gone through patch style problems and reduced number of problems.

Actual complete list attached to the end of the e-mail.

I would like to discuss/get feedback/suggestions for some of reported problems

Quoted 11 lines

WARNING: architecture specific defines should be avoided #117: FILE: hw/can/can_core.c:34:
+#ifdef __linux__

WARNING: architecture specific defines should be avoided #236: FILE: hw/can/can_core.c:153:
+#ifdef __linux__

WARNING: architecture specific defines should be avoided #1869: FILE: include/can/can_emu.h:45:
+#if defined(__GNUC__) || defined(__linux__)

these parts are specific for connection to host system SocketCAN support. Code is written such way that the base infrastructure has no dependence on the host system and providing multiple transports for other systems or UDP/TCP should not be a problem. So I think that limiting of these parts to Linux only is not a problem. It is possible to move these to separate file in the future, but can require to add some more functions to the external interface so keeping in the core
is easier for now. __GNUC__ define is used to allow alignment of data even on non-Linux system to match SocketCAN standard but internally there is no dependence on that so for example on WIndows with other C compiler it is not required

#if defined(__GNUC__) || defined(__linux__)
    #define QEMU_CAN_FRAME_DATA_ALIGN __attribute__((aligned(8)))
#else
    #define QEMU_CAN_FRAME_DATA_ALIGN

#endif

Quoted 7 lines

ERROR: do not use C99 // comments
#724: FILE: hw/can/can_sja1000.c:34:
+// #define DEBUG_FILTER

ERROR: do not use C99 // comments
#1684: FILE: hw/can/can_sja1000.h:39:
+//#define DEBUG_CAN

The DEBUG* defines can be helpful for development and it seems that use of C99 // comments to disable these is widely used practice in the QEMU

Quoted 3 lines

ERROR: externs should be avoided in .c files #305: FILE: hw/can/can_core.c:222:
+int can_bus_host_set_filters(CanBusClientState *,

This function is not used at the actual version and I am not sure if it should get to the external API. But it documents use of filters with SocketCAN so that is why my weak preference is to keep it.

Quoted 3 lines

WARNING: line over 80 characters
#1199: FILE: hw/can/can_sja1000.c:509:
+ s->statusB &= ~(3 << 2); /* Clear transmission complete status, */

How strict is a requirement for 80 characters in qemu? If the slight overflow is caused by comment then I feel better to keep comment descriptive than to short it and moving comment above statement can lead to longer functions bodies and worse reability, at least for me. But if strict 80 chars are preferred I try that.

Quoted 7 lines

WARNING: line over 80 characters
#306: FILE: hw/can/can_core.c:223:
+ const struct qemu_can_filter *filters, size_t filters_cnt);

WARNING: line over 80 characters
#296: FILE: hw/can/can_core.c:213:
+ CanBusHostConnectState *c = container_of(client, CanBusHostConnectState, bus_client);

Then there are function declarations and some code which looks for me much worse readable when wrapped. The length is caused mainly by attempt to provide descriptive identifiers/types names. I personally prefer uniqueness of the identifiers and descriptive names above length. I have correct cases where width is above 90 chars but left some warnings uncorrected.

Thanks for feedback in advance,

Pavel

Actual complete run of the series through scripts/checkpatch.pl

WARNING: architecture specific defines should be avoided #117: FILE: hw/can/can_core.c:34:
+#ifdef __linux__

WARNING: architecture specific defines should be avoided #236: FILE: hw/can/can_core.c:153:
+#ifdef __linux__

WARNING: line over 80 characters
#258: FILE: hw/can/can_core.c:175:
+ CanBusHostConnectState *c = container_of(client, CanBusHostConnectState, bus_client);

WARNING: line over 80 characters
#270: FILE: hw/can/can_core.c:187:
+ CanBusHostConnectState *c = container_of(client, CanBusHostConnectState, bus_client);

WARNING: line over 80 characters
#296: FILE: hw/can/can_core.c:213:
+ CanBusHostConnectState *c = container_of(client, CanBusHostConnectState, bus_client);

ERROR: externs should be avoided in .c files #305: FILE: hw/can/can_core.c:222:
+int can_bus_host_set_filters(CanBusClientState *,

WARNING: line over 80 characters
#306: FILE: hw/can/can_core.c:223:
+ const struct qemu_can_filter *filters, size_t filters_cnt);

WARNING: line over 80 characters
#309: FILE: hw/can/can_core.c:226:
+ const struct qemu_can_filter *filters, size_t filters_cnt)

WARNING: line over 80 characters
#311: FILE: hw/can/can_core.c:228:
+ CanBusHostConnectState *c = container_of(client, CanBusHostConnectState, bus_client);

WARNING: line over 80 characters
#635: FILE: hw/can/can_pci.c:192:
+ VMSTATE_STRUCT(sja_state, CanPCIState, 0, vmstate_can_sja, CanSJA1000State),

ERROR: do not use C99 // comments
#724: FILE: hw/can/can_sja1000.c:34:
+// #define DEBUG_FILTER

WARNING: line over 80 characters
#919: FILE: hw/can/can_sja1000.c:229:
+ buff[++count] = (frame->can_id << 05) & 0xe0; /* ID.02~ID.00,x,x,x,x,x */

WARNING: line over 80 characters
#1096: FILE: hw/can/can_sja1000.c:406:
+ s->statusP &= ~(3 << 2); /* Clear transmission complete status, */

WARNING: line over 80 characters
#1199: FILE: hw/can/can_sja1000.c:509:
+ s->statusB &= ~(3 << 2); /* Clear transmission complete status, */

WARNING: line over 80 characters
#1221: FILE: hw/can/can_sja1000.c:531:
+ printf(" %02X", s->rx_buff[(s->rxbuf_start + i) % SJA_RCV_BUF_LEN]);

WARNING: line over 80 characters
#1315: FILE: hw/can/can_sja1000.c:625:
+ case 8: /* Output control register, hardware related, not support now. */

WARNING: line over 80 characters
#1346: FILE: hw/can/can_sja1000.c:656:
+ temp = s->rx_buff[(s->rxbuf_start + addr - 16) % SJA_RCV_BUF_LEN];

ERROR: do not use C99 // comments
#1684: FILE: hw/can/can_sja1000.h:39:
+//#define DEBUG_CAN

WARNING: line over 80 characters
#1702: FILE: hw/can/can_sja1000.h:57:
+ uint8_t interrupt_en; /* PeliCAN, addr 4, Interrupt Enable register */

WARNING: line over 80 characters
#1703: FILE: hw/can/can_sja1000.h:58:
+ uint8_t rxmsg_cnt; /* PeliCAN, addr 29, RX message counter. DS-p49 */

WARNING: line over 80 characters
#1704: FILE: hw/can/can_sja1000.h:59:
+ uint8_t rxbuf_start; /* PeliCAN, addr 30, RX buffer start address, DS-p49 */

WARNING: line over 80 characters
#1705: FILE: hw/can/can_sja1000.h:60:
+ uint8_t clock; /* PeliCAN, addr 31, Clock Divider register, DS-p55 */

WARNING: line over 80 characters
#1719: FILE: hw/can/can_sja1000.h:74:
+ uint8_t code; /* BasicCAN, addr 4, Acceptance code register */

WARNING: line over 80 characters
#1720: FILE: hw/can/can_sja1000.h:75:
+ uint8_t mask; /* BasicCAN, addr 5, Acceptance mask register */

WARNING: line over 80 characters
#1765: FILE: hw/can/can_sja1000.h:120:
+/* ID bytes (11 bits in 0 and 1 or 16 bits in 0,1 and 13 bits in 2,3 (extended)) */

WARNING: architecture specific defines should be avoided #1869: FILE: include/can/can_emu.h:45:
+#if defined(__GNUC__) || defined(__linux__)

total: 3 errors, 23 warnings, 1870 lines checked

/home/pi/patches/qemu/out/0001-CAN-bus-simple-SJA1000-PCI-card-emulation-for-QEMU.patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
WARNING: line over 80 characters
#152: FILE: hw/can/can_kvaser_pci.c:121:
+static uint64_t kvaser_pci_s5920_io_read(void *opaque, hwaddr addr, unsigned size)

WARNING: line over 80 characters
#211: FILE: hw/can/can_kvaser_pci.c:180:
+static uint64_t kvaser_pci_xilinx_io_read(void *opaque, hwaddr addr, unsigned size)

WARNING: line over 80 characters
#310: FILE: hw/can/can_kvaser_pci.c:279:
+ pci_register_bar(&d->dev, /*BAR*/ 0, PCI_BASE_ADDRESS_SPACE_IO, &d->s5920_io);

WARNING: line over 80 characters
#312: FILE: hw/can/can_kvaser_pci.c:281:
+ pci_register_bar(&d->dev, /*BAR*/ 2, PCI_BASE_ADDRESS_SPACE_IO, &d->xilinx_io);

WARNING: line over 80 characters
#346: FILE: hw/can/can_kvaser_pci.c:315:
+ VMSTATE_STRUCT(sja_state, KvaserPCIState, 0, vmstate_can_sja, CanSJA1000State),

total: 0 errors, 5 warnings, 370 lines checked

/home/pi/patches/qemu/out/0002-CAN-bus-Kvaser-PCI-CAN-S-single-SJA1000-channel-emul.patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
WARNING: line over 80 characters
#77: FILE: hw/can/can_pcm3680_pci.c:46:
+#define PCM3680i_PCI_VENDOR_ID1 0x13fe /* the PCI device and vendor IDs */

WARNING: line over 80 characters
#120: FILE: hw/can/can_pcm3680_pci.c:89:
+static uint64_t pcm3680i_pci_sja1_io_read(void *opaque, hwaddr addr, unsigned size)

WARNING: line over 80 characters
#145: FILE: hw/can/can_pcm3680_pci.c:114:
+static uint64_t pcm3680i_pci_sja2_io_read(void *opaque, hwaddr addr, unsigned size)

WARNING: line over 80 characters
#258: FILE: hw/can/can_pcm3680_pci.c:227:
+ pci_register_bar(&d->dev, /*BAR*/ 0, PCI_BASE_ADDRESS_SPACE_IO, &d->sja_io[0]);

WARNING: line over 80 characters
#259: FILE: hw/can/can_pcm3680_pci.c:228:
+ pci_register_bar(&d->dev, /*BAR*/ 1, PCI_BASE_ADDRESS_SPACE_IO, &d->sja_io[1]);

total: 0 errors, 5 warnings, 321 lines checked

/home/pi/patches/qemu/out/0003-CAN-bus-PCM-3680I-PCI-dual-SJA1000-channel-emulation.patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 39 lines checked

/home/pi/patches/qemu/out/0004-Fixed-IRQ-problem-for-CAN-device-can_pcm3680_pci.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 19 lines checked

/home/pi/patches/qemu/out/0005-Minor-clean-up-of-can_pcm3680_pci.patch has no obvious style problems and is ready for submission.
WARNING: line over 80 characters
#77: FILE: hw/can/can_mioe3680_pci.c:46:
+#define MIOe3680_PCI_VENDOR_ID1 0x13fe /* the PCI device and vendor IDs */

WARNING: line over 80 characters
#127: FILE: hw/can/can_mioe3680_pci.c:96:
+static uint64_t mioe3680_pci_sja1_io_read(void *opaque, hwaddr addr, unsigned size)

WARNING: line over 80 characters
#152: FILE: hw/can/can_mioe3680_pci.c:121:
+static uint64_t mioe3680_pci_sja2_io_read(void *opaque, hwaddr addr, unsigned size)

WARNING: line over 80 characters
#228: FILE: hw/can/can_mioe3680_pci.c:197:
+ error_report("Cannot connect CAN bus to host #1 device \"%s\"", d->host[0]);

WARNING: line over 80 characters
#235: FILE: hw/can/can_mioe3680_pci.c:204:
+ error_report("Cannot connect CAN bus to host #2 device \"%s\"", d->host[1]);

WARNING: line over 80 characters
#265: FILE: hw/can/can_mioe3680_pci.c:234:
+ pci_register_bar(&d->dev, /*BAR*/ 0, PCI_BASE_ADDRESS_SPACE_IO, &d->sja_io[0]);

WARNING: line over 80 characters
#266: FILE: hw/can/can_mioe3680_pci.c:235:
+ pci_register_bar(&d->dev, /*BAR*/ 1, PCI_BASE_ADDRESS_SPACE_IO, &d->sja_io[1]);

total: 0 errors, 7 warnings, 329 lines checked

/home/pi/patches/qemu/out/0006-CAN-bus-MIOe-3680-PCI-dual-SJA1000-channel-emulation.patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.