Skip to content
Snippets Groups Projects
  1. Feb 09, 2017
  2. Jan 28, 2017
  3. Jan 25, 2017
  4. Jan 20, 2017
  5. Jan 19, 2017
    • Bhumika Goyal's avatar
      virtio/s390: virtio: constify virtio_config_ops structures · 0db1dba5
      Bhumika Goyal authored
      
      Declare virtio_config_ops structure as const as it is only stored in the
      config field of a virtio_device structure. This field is of type const, so
      virtio_config_ops structures having this property can be declared const.
      Done using Coccinelle:
      
      @r1 disable optional_qualifier@
      identifier i;
      position p;
      @@
      static struct virtio_config_ops i@p={...};
      
      @ok1@
      identifier r1.i;
      position p;
      struct virtio_ccw_device x;
      @@
      x.vdev.config=&i@p
      
      @bad@
      position p!={r1.p,ok1.p};
      identifier r1.i;
      @@
      i@p
      
      @depends on !bad disable optional_qualifier@
      identifier r1.i;
      @@
      +const
      struct virtio_config_ops i;
      
      File size before and after applying the patch remains the same.
      text	data	bss	dec	hex   filename
      9235	296	32928	42459	a5db  drivers/s390/virtio/virtio_ccw.o
      
      Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
      Message-Id: <1484333336-13443-1-git-send-email-bhumirks@gmail.com>
      Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
      0db1dba5
    • Colin Ian King's avatar
      virtio/s390: add missing \n to end of dev_err message · 99240622
      Colin Ian King authored
      
      Trival fix, dev_err message is missing a \n, so add it.
      
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Message-Id: <20160927200844.16008-1-colin.king@canonical.com>
      Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
      99240622
    • Pierre Morel's avatar
      virtio/s390: support READ_STATUS command for virtio-ccw · 7d3ce5ab
      Pierre Morel authored
      
      As virtio-1 introduced the possibility of the device manipulating the
      status byte, revision 2 of the virtio-ccw transport introduced a means
      of getting the status byte from the device via READ_STATUS. Let's wire
      it up for revisions >= 2 and fall back to returning the stored status
      byte if not supported.
      
      Signed-off-by: default avatarPierre Morel <pmorel@linux.vnet.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
      7d3ce5ab
    • G. Campana's avatar
      virtio_console: fix a crash in config_work_handler · 8379cadf
      G. Campana authored
      
      Using control_work instead of config_work as the 3rd argument to
      container_of results in an invalid portdev pointer. Indeed, the work
      structure is initialized as below:
      
          INIT_WORK(&portdev->config_work, &config_work_handler);
      
      It leads to a crash when portdev->vdev is dereferenced later. This
      bug
      is triggered when the guest uses a virtio-console without multiport
      feature and receives a config_changed virtio interrupt.
      
      Signed-off-by: default avatarG. Campana <gcampana@quarkslab.com>
      Reviewed-by: default avatarAmit Shah <amit.shah@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      8379cadf
    • Dan Carpenter's avatar
      vhost/scsi: silence uninitialized variable warning · 532e15af
      Dan Carpenter authored
      
      This is to silence an uninitialized variable warning in debug output.
      The problem is this line:
      
      	pr_debug("vhost_get_vq_desc: head: %d, out: %u in: %u\n",
      		 head, out, in);
      
      If "head == vq->num" is true on the first iteration then "out" and "in"
      aren't initialized.  We handle that a few lines after the printk.  I was
      tempted to just delete the pr_debug() but I decided to just initialize
      them to zero instead.
      
      Also checkpatch.pl complains if variables are declared as just
      "unsigned" without the "int".
      
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      532e15af
    • Bhumika Goyal's avatar
      vhost: scsi: constify target_core_fabric_ops structures · 1d822a40
      Bhumika Goyal authored
      
      Declare target_core_fabric_ops strucrues as const as they are only
      passed as an argument to the functions target_register_template and
      target_unregister_template. The arguments are of type const struct
      target_core_fabric_ops *, so target_core_fabric_ops structures having
      this property can be declared const.
      Done using Coccinelle:
      
      @r disable optional_qualifier@
      identifier i;
      position p;
      @@
      static struct target_core_fabric_ops i@p={...};
      
      @ok@
      position p;
      identifier r.i;
      @@
      (
      target_register_template(&i@p)
      |
      target_unregister_template(&i@p)
      )
      @bad@
      position p!={r.p,ok.p};
      identifier r.i;
      @@
      i@p
      
      @depends on !bad disable optional_qualifier@
      identifier r.i;
      @@
      +const
      struct target_core_fabric_ops i;
      
      File size before: drivers/vhost/scsi.o
         text	   data	    bss	    dec	    hex	filename
        18063	   2985	     40	  21088	   5260	drivers/vhost/scsi.o
      
      File size after: drivers/vhost/scsi.o
         text	   data	    bss	    dec	    hex	filename
        18479	   2601	     40	  21120	   5280	drivers/vhost/scsi.o
      
      Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      1d822a40
    • Josef Bacik's avatar
      nbd: only set MSG_MORE when we have more to send · d61b7f97
      Josef Bacik authored
      
      A user noticed that write performance was horrible over loopback and we
      traced it to an inversion of when we need to set MSG_MORE.  It should be
      set when we have more bvec's to send, not when we are on the last bvec.
      This patch made the test go from 20 iops to 78k iops.
      
      Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
      Fixes: 429a787b ("nbd: fix use-after-free of rq/bio in the xmit path")
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      d61b7f97
    • Jason Gerecke's avatar
      HID: wacom: Fix sibling detection regression · a9ce7856
      Jason Gerecke authored
      
      Commit 345857bb ("HID: wacom: generic: Add support for sensor offsets") included
      a change to the operation and location of the call to 'wacom_add_shared_data'
      in 'wacom_parse_and_register'. The modifications included moving it higher up
      so that it would occur before the call to 'wacom_retrieve_hid_descriptor'. This
      was done to prevent a crash that would have occured when the report containing
      tablet offsets was fed into the driver with 'wacom_hid_report_raw_event'
      (specifically: the various 'wacom_wac_*_report' functions were written with the
      assumption that they would only be called once tablet setup had completed;
      'wacom_wac_pen_report' in particular dereferences 'shared' which wasn't yet
      allocated).
      
      Moving the call to 'wacom_add_shared_data' effectively prevented the crash but
      also broke the sibiling detection code which assumes that the HID descriptor
      has been read and the various device_type flags set.
      
      To fix this situation, we restore the original 'wacom_add_shared_data'
      operation and location and instead implement an alternative change that can
      also prevent the crash. Specifically, we notice that the report functions
      mentioned above expect to be called only for input reports.  By adding a check,
      we can prevent feature reports (such as the offset report) from
      causing trouble.
      
      Fixes: 345857bb ("HID: wacom: generic: Add support for sensor offsets")
      Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      Tested-by: default avatarPing Cheng <pingc@wacom.com>
      Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      a9ce7856
  6. Jan 17, 2017
Loading