qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 06/27] vhost-user-scsi: code style fixes


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH 06/27] vhost-user-scsi: code style fixes
Date: Wed, 23 Aug 2017 23:54:39 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 08/23/2017 01:19 PM, Marc-André Lureau wrote:
Signed-off-by: Marc-André Lureau <address@hidden>

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>

---
  contrib/vhost-user-scsi/vhost-user-scsi.c | 20 ++++++++++++--------
  1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c 
b/contrib/vhost-user-scsi/vhost-user-scsi.c
index cddaaf8995..8d6ff18cc4 100644
--- a/contrib/vhost-user-scsi/vhost-user-scsi.c
+++ b/contrib/vhost-user-scsi/vhost-user-scsi.c
@@ -305,7 +305,8 @@ fail:
  }
static struct scsi_task *scsi_task_new(int cdb_len, uint8_t *cdb, int dir,
-                                       int xfer_len) {
+                                       int xfer_len)
+{
      struct scsi_task *task;
assert(cdb_len > 0);
@@ -344,7 +345,8 @@ static int handle_cmd_sync(struct iscsi_context *ctx,
                             VirtIOSCSICmdReq *req,
                             struct iovec *out, unsigned int out_len,
                             VirtIOSCSICmdResp *rsp,
-                           struct iovec *in, unsigned int in_len) {
+                           struct iovec *in, unsigned int in_len)
+{
      struct scsi_task *task;
      uint32_t dir;
      uint32_t len;
@@ -454,7 +456,8 @@ static void vus_panic_cb(VuDev *vu_dev, const char *buf)
  }
static void vus_add_watch_cb(VuDev *vu_dev, int fd, int vu_evt, vu_watch_cb cb,
-                             void *pvt) {
+                             void *pvt)
+{
      vhost_scsi_dev_t *vdev_scsi;
      guint id;
@@ -529,7 +532,7 @@ static void vus_proc_req(VuDev *vu_dev, int idx)
          return;
      }
- if ((idx < 0) || (idx >= VHOST_MAX_NR_VIRTQUEUE)) {
+    if (idx < 0 || idx >= VHOST_MAX_NR_VIRTQUEUE) {
          PERR("VQ Index out of range: %d", idx);
          vus_panic_cb(vu_dev, NULL);
          return;
@@ -556,8 +559,8 @@ static void vus_proc_req(VuDev *vu_dev, int idx)
          }
          PDBG("Popped address@hidden", elem);
- assert(!((elem->out_num > 1) && (elem->in_num > 1)));
-        assert((elem->out_num > 0) && (elem->in_num > 0));
+        assert(!(elem->out_num > 1 && elem->in_num > 1));
+        assert(elem->out_num > 0 && elem->in_num > 0);
if (elem->out_sg[0].iov_len < sizeof(VirtIOSCSICmdReq)) {
              PERR("Invalid virtio-scsi req header");
@@ -593,7 +596,7 @@ static void vus_queue_set_started(VuDev *vu_dev, int idx, 
bool started)
assert(vu_dev); - if ((idx < 0) || (idx >= VHOST_MAX_NR_VIRTQUEUE)) {
+    if (idx < 0 || idx >= VHOST_MAX_NR_VIRTQUEUE) {
          PERR("VQ Index out of range: %d", idx);
          vus_panic_cb(vu_dev, NULL);
          return;
@@ -750,7 +753,8 @@ err:
  }
static int vdev_scsi_add_iscsi_lun(vhost_scsi_dev_t *vdev_scsi,
-                                   char *iscsi_uri, uint32_t lun) {
+                                   char *iscsi_uri, uint32_t lun)
+{
      assert(vdev_scsi);
      assert(iscsi_uri);
      assert(lun < VUS_MAX_LUNS);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]