All of lore.kernel.org
 help / color / mirror / Atom feed
From: no-reply@patchew.org
To: felipe@nutanix.com
Cc: famz@redhat.com, pbonzini@redhat.com, stefanha@redhat.com,
	marcandre.lureau@redhat.com, mst@redhat.com,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v5 0/4] Introduce vhost-user-scsi and sample application
Date: Thu, 2 Mar 2017 10:31:31 -0800 (PST)	[thread overview]
Message-ID: <148847949092.285.1729819062842356358@0e2666bad730> (raw)
In-Reply-To: <1488479153-21203-1-git-send-email-felipe@nutanix.com>

Hi,

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

Message-id: 1488479153-21203-1-git-send-email-felipe@nutanix.com
Type: series
Subject: [Qemu-devel] [PATCH v5 0/4] Introduce vhost-user-scsi and sample application

=== 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/1488479153-21203-1-git-send-email-felipe@nutanix.com -> patchew/1488479153-21203-1-git-send-email-felipe@nutanix.com
 - [tag update]      patchew/20170301090453.11075-1-marcandre.lureau@redhat.com -> patchew/20170301090453.11075-1-marcandre.lureau@redhat.com
Switched to a new branch 'test'
f329fa1 vus: Introduce a vhost-user-scsi sample application
bb04fd0 vus: Introduce vhost-user-scsi host device
e8df419 vhost-scsi: create a vhost-scsi-common abstraction
010a9c6 libvhost-user: replace vasprintf() to fix build

=== OUTPUT BEGIN ===
Checking PATCH 1/4: libvhost-user: replace vasprintf() to fix build...
Checking PATCH 2/4: vhost-scsi: create a vhost-scsi-common abstraction...
Checking PATCH 3/4: vus: Introduce vhost-user-scsi host device...
ERROR: do not use C99 // comments
#204: FILE: hw/scsi/vhost-user-scsi.c:145:
+    // Turn on predefined features supported by this device

ERROR: do not use C99 // comments
#249: FILE: hw/scsi/vhost-user-scsi.c:190:
+    // Add the bootindex property for this object

ERROR: do not use C99 // comments
#253: FILE: hw/scsi/vhost-user-scsi.c:194:
+    // Set boot index according the the device config

total: 3 errors, 0 warnings, 376 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/4: vus: Introduce a vhost-user-scsi sample application...
ERROR: do not use C99 // comments
#114: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:28:
+//#define VUS_DEBUG 1

ERROR: spaces required around that '/' (ctx:VxV)
#128: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:42:
+            timebuf, ts.tv_nsec/1000,                                 \
                                ^

ERROR: __func__ should be used instead of gcc specific __FUNCTION__
#129: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:43:
+            __FILE__, __FUNCTION__, __LINE__, ## __VA_ARGS__);        \

ERROR: space required before the open parenthesis '('
#130: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:44:
+} while(0)

ERROR: spaces required around that '/' (ctx:VxV)
#135: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:49:
+            timebuf, ts.tv_nsec/1000, ## __VA_ARGS__);                \
                                ^

ERROR: space required before the open parenthesis '('
#136: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:50:
+} while(0);

ERROR: do not use C99 // comments
#150: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:64:
+#define VUS_MAX_LUNS 1 // Only 1 lun supported today

ERROR: do not use C99 // comments
#151: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:65:
+#define VUS_MAX_DEVS 1 // Only 1 devices supported today

ERROR: do not use C99 // comments
#164: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:78:
+    GTree *fdmap;   // maps fd to gsource context id

ERROR: trailing statements should be on next line
#181: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:95:
+    if (b > a) return 1;

ERROR: braces {} are necessary for all arms of this statement
#181: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:95:
+    if (b > a) return 1;
[...]

ERROR: trailing statements should be on next line
#182: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:96:
+    if (b < a) return -1;

ERROR: braces {} are necessary for all arms of this statement
#182: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:96:
+    if (b < a) return -1;
[...]

ERROR: trailing statements should be on next line
#218: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:132:
+        if (vus_src->gfd.events & G_IO_IN)  vu_evt |= VU_WATCH_IN;

ERROR: braces {} are necessary for all arms of this statement
#218: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:132:
+        if (vus_src->gfd.events & G_IO_IN)  vu_evt |= VU_WATCH_IN;
[...]

ERROR: trailing statements should be on next line
#219: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:133:
+        if (vus_src->gfd.events & G_IO_OUT) vu_evt |= VU_WATCH_OUT;

ERROR: braces {} are necessary for all arms of this statement
#219: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:133:
+        if (vus_src->gfd.events & G_IO_OUT) vu_evt |= VU_WATCH_OUT;
[...]

ERROR: trailing statements should be on next line
#220: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:134:
+        if (vus_src->gfd.events & G_IO_PRI) vu_evt |= VU_WATCH_PRI;

ERROR: braces {} are necessary for all arms of this statement
#220: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:134:
+        if (vus_src->gfd.events & G_IO_PRI) vu_evt |= VU_WATCH_PRI;
[...]

ERROR: trailing statements should be on next line
#221: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:135:
+        if (vus_src->gfd.events & G_IO_ERR) vu_evt |= VU_WATCH_ERR;

ERROR: braces {} are necessary for all arms of this statement
#221: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:135:
+        if (vus_src->gfd.events & G_IO_ERR) vu_evt |= VU_WATCH_ERR;
[...]

ERROR: trailing statements should be on next line
#222: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:136:
+        if (vus_src->gfd.events & G_IO_HUP) vu_evt |= VU_WATCH_HUP;

ERROR: braces {} are necessary for all arms of this statement
#222: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:136:
+        if (vus_src->gfd.events & G_IO_HUP) vu_evt |= VU_WATCH_HUP;
[...]

ERROR: use QEMU instead of Qemu or QEmu
#282: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:196:
+ *     Qemu's scsi.h also defines "SCSI_XFER_NONE".

ERROR: open brace '{' following function declarations go on the next line
#363: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:277:
+static int iscsi_add_lun(iscsi_lun_t *lun, char *iscsi_uri) {

ERROR: open brace '{' following function declarations go on the next line
#428: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:342:
+static int get_cdb_len(uint8_t *cdb) {

ERROR: spaces required around that '>>' (ctx:VxV)
#438: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:352:
+    PERR("Unable to determine cdb len (0x%02hhX)", cdb[0]>>5);
                                                          ^

ERROR: do not use C99 // comments
#458: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:372:
+        // Ignore anything different than target=0, lun=0

ERROR: spaces required around that '=' (ctx:VxV)
#482: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:396:
+        for (i=0; i<out_len; i++) {
               ^

ERROR: spaces required around that '<' (ctx:VxV)
#482: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:396:
+        for (i=0; i<out_len; i++) {
                    ^

ERROR: spaces required around that '=' (ctx:VxV)
#487: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:401:
+        for (i=0; i<in_len; i++) {
               ^

ERROR: spaces required around that '<' (ctx:VxV)
#487: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:401:
+        for (i=0; i<in_len; i++) {
                    ^

ERROR: open brace '{' following function declarations go on the next line
#537: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:451:
+static void vus_panic_cb(VuDev *vu_dev, const char *buf) {

ERROR: trailing statements should be on next line
#579: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:493:
+    if (vu_evt & VU_WATCH_IN)  conds |= G_IO_IN;

ERROR: braces {} are necessary for all arms of this statement
#579: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:493:
+    if (vu_evt & VU_WATCH_IN)  conds |= G_IO_IN;
[...]

ERROR: trailing statements should be on next line
#580: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:494:
+    if (vu_evt & VU_WATCH_OUT) conds |= G_IO_OUT;

ERROR: braces {} are necessary for all arms of this statement
#580: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:494:
+    if (vu_evt & VU_WATCH_OUT) conds |= G_IO_OUT;
[...]

ERROR: trailing statements should be on next line
#581: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:495:
+    if (vu_evt & VU_WATCH_PRI) conds |= G_IO_PRI;

ERROR: braces {} are necessary for all arms of this statement
#581: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:495:
+    if (vu_evt & VU_WATCH_PRI) conds |= G_IO_PRI;
[...]

ERROR: trailing statements should be on next line
#582: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:496:
+    if (vu_evt & VU_WATCH_ERR) conds |= G_IO_ERR;

ERROR: braces {} are necessary for all arms of this statement
#582: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:496:
+    if (vu_evt & VU_WATCH_ERR) conds |= G_IO_ERR;
[...]

ERROR: trailing statements should be on next line
#583: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:497:
+    if (vu_evt & VU_WATCH_HUP) conds |= G_IO_HUP;

ERROR: braces {} are necessary for all arms of this statement
#583: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:497:
+    if (vu_evt & VU_WATCH_HUP) conds |= G_IO_HUP;
[...]

ERROR: open brace '{' following function declarations go on the next line
#590: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:504:
+static void vus_del_watch_cb(VuDev *vu_dev, int fd) {

ERROR: open brace '{' following function declarations go on the next line
#613: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:527:
+static void vus_proc_ctl(VuDev *vu_dev, int idx) {

ERROR: open brace '{' following function declarations go on the next line
#617: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:531:
+static void vus_proc_evt(VuDev *vu_dev, int idx) {

ERROR: open brace '{' following function declarations go on the next line
#621: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:535:
+static void vus_proc_req(VuDev *vu_dev, int idx) {

ERROR: space required before the open parenthesis '('
#648: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:562:
+    while(1) {

ERROR: spaces required around that '-' (ctx:VxV)
#678: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:592:
+                            req, &elem->out_sg[1], elem->out_num-1,
                                                                 ^

ERROR: spaces required around that '-' (ctx:VxV)
#679: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:593:
+                            rsp, &elem->in_sg[1], elem->in_num-1) != 0) {
                                                               ^

ERROR: open brace '{' following function declarations go on the next line
#691: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:605:
+static void vus_queue_set_started(VuDev *vu_dev, int idx, bool started) {

ERROR: space required before the open parenthesis '('
#704: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:618:
+    switch(idx) {

ERROR: spaces required around that '?' (ctx:VxV)
#706: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:620:
+        vu_set_queue_handler(vu_dev, vq, started?vus_proc_ctl:NULL);
                                                 ^

ERROR: spaces required around that ':' (ctx:VxV)
#706: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:620:
+        vu_set_queue_handler(vu_dev, vq, started?vus_proc_ctl:NULL);
                                                              ^

ERROR: spaces required around that '?' (ctx:VxV)
#709: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:623:
+        vu_set_queue_handler(vu_dev, vq, started?vus_proc_evt:NULL);
                                                 ^

ERROR: spaces required around that ':' (ctx:VxV)
#709: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:623:
+        vu_set_queue_handler(vu_dev, vq, started?vus_proc_evt:NULL);
                                                              ^

ERROR: spaces required around that '?' (ctx:VxV)
#712: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:626:
+        vu_set_queue_handler(vu_dev, vq, started?vus_proc_req:NULL);
                                                 ^

ERROR: spaces required around that ':' (ctx:VxV)
#712: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:626:
+        vu_set_queue_handler(vu_dev, vq, started?vus_proc_req:NULL);
                                                              ^

ERROR: open brace '{' following function declarations go on the next line
#720: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:634:
+static gboolean vus_vhost_cb(gpointer data) {

ERROR: open brace '{' following function declarations go on the next line
#736: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:650:
+static int unix_sock_new(char *unix_fn) {

ERROR: open brace '{' following function declarations go on the next line
#774: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:688:
+static vhost_scsi_dev_t *vdev_scsi_find_by_vu(VuDev *vu_dev) {

ERROR: spaces required around that '=' (ctx:VxV)
#779: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:693:
+    for (i=0; i<VUS_MAX_DEVS; i++) {
           ^

ERROR: spaces required around that '<' (ctx:VxV)
#779: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:693:
+    for (i=0; i<VUS_MAX_DEVS; i++) {
                ^

ERROR: open brace '{' following function declarations go on the next line
#789: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:703:
+static void vdev_scsi_deinit(vhost_scsi_dev_t *vdev_scsi) {

ERROR: open brace '{' following function declarations go on the next line
#814: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:728:
+static vhost_scsi_dev_t *vdev_scsi_new(char *unix_fn) {

ERROR: open brace '{' following function declarations go on the next line
#869: FILE: contrib/vhost-user-scsi/vhost-user-scsi.c:783:
+static int vdev_scsi_run(vhost_scsi_dev_t *vdev_scsi) {

total: 66 errors, 0 warnings, 919 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 patchew-devel@freelists.org

  parent reply	other threads:[~2017-03-02 18:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02 18:25 [Qemu-devel] [PATCH v5 0/4] Introduce vhost-user-scsi and sample application Felipe Franciosi
2017-03-02 18:25 ` [Qemu-devel] [PATCH v5 1/4] libvhost-user: replace vasprintf() to fix build Felipe Franciosi
2017-03-02 19:28   ` Eric Blake
2017-03-02 18:25 ` [Qemu-devel] [PATCH v5 2/4] vhost-scsi: create a vhost-scsi-common abstraction Felipe Franciosi
2017-03-02 18:25 ` [Qemu-devel] [PATCH v5 3/4] vus: Introduce vhost-user-scsi host device Felipe Franciosi
2017-03-02 18:25 ` [Qemu-devel] [PATCH v5 4/4] vus: Introduce a vhost-user-scsi sample application Felipe Franciosi
2017-03-02 18:31 ` no-reply [this message]
2017-03-02 18:32 ` [Qemu-devel] [PATCH v5 0/4] Introduce vhost-user-scsi and " no-reply
2017-03-02 18:46 ` no-reply
2017-03-02 21:47 ` Michael S. Tsirkin
2017-04-21 14:53   ` Felipe Franciosi
2017-07-06 13:41     ` Michael S. Tsirkin
2017-07-06 16:54       ` Harris, James R
2017-07-06 16:56         ` Paolo Bonzini
2017-07-06 17:03           ` Harris, James R
2017-07-06 17:06             ` Paolo Bonzini
2017-07-06 17:38               ` Harris, James R
2017-07-06 17:11             ` Marc-André Lureau
2017-07-06 17:44               ` Harris, James R

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=148847949092.285.1729819062842356358@0e2666bad730 \
    --to=no-reply@patchew.org \
    --cc=famz@redhat.com \
    --cc=felipe@nutanix.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.