search for: virtio_cwrite8

Displaying 20 results from an estimated 24 matches for "virtio_cwrite8".

Did you mean: virtio_cwrite
2017 Jun 09
3
[PATCH v1] virtio_blk: Use sysfs_match_string() helper
...; BUG_ON(!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_CONFIG_WCE)); - for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; ) - if (sysfs_streq(buf, virtblk_cache_types[i])) - break; - + i = sysfs_match_string(virtblk_cache_types, buf); if (i < 0) - return -EINVAL; + return i; virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce), i); virtblk_update_cache_mode(vdev); -- 2.11.0
2017 Jun 09
3
[PATCH v1] virtio_blk: Use sysfs_match_string() helper
...; BUG_ON(!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_CONFIG_WCE)); - for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; ) - if (sysfs_streq(buf, virtblk_cache_types[i])) - break; - + i = sysfs_match_string(virtblk_cache_types, buf); if (i < 0) - return -EINVAL; + return i; virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce), i); virtblk_update_cache_mode(vdev); -- 2.11.0
2015 Mar 31
2
[PATCH] virtio_config: reorder functions
...virtio_cread_bytes(struct virtio_device *vdev, __virtio_cread_many(vdev, offset, buf, len, 1); } +static inline u8 virtio_cread8(struct virtio_device *vdev, unsigned int offset) +{ + u8 ret; + vdev->config->get(vdev, offset, &ret, sizeof(ret)); + return ret; +} + static inline void virtio_cwrite8(struct virtio_device *vdev, unsigned int offset, u8 val) { -- MST
2015 Mar 31
2
[PATCH] virtio_config: reorder functions
...virtio_cread_bytes(struct virtio_device *vdev, __virtio_cread_many(vdev, offset, buf, len, 1); } +static inline u8 virtio_cread8(struct virtio_device *vdev, unsigned int offset) +{ + u8 ret; + vdev->config->get(vdev, offset, &ret, sizeof(ret)); + return ret; +} + static inline void virtio_cwrite8(struct virtio_device *vdev, unsigned int offset, u8 val) { -- MST
2014 Dec 15
8
[PATCH 0/6] virtio 1.0 fixups, tweaks
Fixes a couple of minor compliance issues in new virtio 1.0 code. Plus, adds a couple of minor cleanups - not bugfixes, but seem safe enough for 3.19. Michael S. Tsirkin (6): virtio: set VIRTIO_CONFIG_S_FEATURES_OK on restore virtio_config: fix virtio_cread_bytes virtio_pci_common.h: drop VIRTIO_PCI_NO_LEGACY virtio_pci: move probe to common file virtio_pci: add VIRTIO_PCI_NO_LEGACY
2014 Dec 15
8
[PATCH 0/6] virtio 1.0 fixups, tweaks
Fixes a couple of minor compliance issues in new virtio 1.0 code. Plus, adds a couple of minor cleanups - not bugfixes, but seem safe enough for 3.19. Michael S. Tsirkin (6): virtio: set VIRTIO_CONFIG_S_FEATURES_OK on restore virtio_config: fix virtio_cread_bytes virtio_pci_common.h: drop VIRTIO_PCI_NO_LEGACY virtio_pci: move probe to common file virtio_pci: add VIRTIO_PCI_NO_LEGACY
2015 Apr 08
0
[PATCH] virtio_config: reorder functions
...__virtio_cread_many(vdev, offset, buf, len, 1); > } > > +static inline u8 virtio_cread8(struct virtio_device *vdev, unsigned int offset) > +{ > + u8 ret; > + vdev->config->get(vdev, offset, &ret, sizeof(ret)); > + return ret; > +} > + > static inline void virtio_cwrite8(struct virtio_device *vdev, > unsigned int offset, u8 val) > { > -- > MST
2016 Apr 01
0
[patch] virtio: silence uninitialized variable warnings
...@@ static inline void virtio_cread_bytes(struct virtio_device *vdev, static inline u8 virtio_cread8(struct virtio_device *vdev, unsigned int offset) { - u8 ret; + u8 ret = 0; vdev->config->get(vdev, offset, &ret, sizeof(ret)); return ret; } @@ -348,7 +348,7 @@ static inline void virtio_cwrite8(struct virtio_device *vdev, static inline u16 virtio_cread16(struct virtio_device *vdev, unsigned int offset) { - u16 ret; + u16 ret = 0; vdev->config->get(vdev, offset, &ret, sizeof(ret)); return virtio16_to_cpu(vdev, (__force __virtio16)ret); } @@ -363,7 +363,7 @@ static in...
2017 Jul 03
0
[PATCH v1] virtio_blk: Use sysfs_match_string() helper
...RTIO_BLK_F_CONFIG_WCE)); > - for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; ) > - if (sysfs_streq(buf, virtblk_cache_types[i])) > - break; > - > + i = sysfs_match_string(virtblk_cache_types, buf); > ? if (i < 0) > - return -EINVAL; > + return i; > ? > ? virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce), > i); > ? virtblk_update_cache_mode(vdev); -- Andy Shevchenko <andriy.shevchenko at linux.intel.com> Intel Finland Oy
2017 Jul 03
2
[PATCH v1] virtio_blk: Use sysfs_match_string() helper
...Y_SIZE(virtblk_cache_types); --i >= 0; ) > > - if (sysfs_streq(buf, virtblk_cache_types[i])) > > - break; > > - > > + i = sysfs_match_string(virtblk_cache_types, buf); > > ? if (i < 0) > > - return -EINVAL; > > + return i; > > ? > > ? virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce), > > i); > > ? virtblk_update_cache_mode(vdev); > > -- > Andy Shevchenko <andriy.shevchenko at linux.intel.com> > Intel Finland Oy
2020 Aug 05
0
[PATCH v3 23/38] virtio_config: cread/write cleanup
...+++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index c68f58f3bf34..5c3b02245ecd 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -444,53 +444,60 @@ static inline void virtio_cwrite8(struct virtio_device *vdev, static inline u16 virtio_cread16(struct virtio_device *vdev, unsigned int offset) { - u16 ret; + __virtio16 ret; might_sleep(); vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return virtio16_to_cpu(vdev, (__force __virtio16)ret); + return v...
2016 Apr 01
0
[patch] virtio: silence uninitialized variable warnings
...@@ static inline void virtio_cread_bytes(struct virtio_device *vdev, static inline u8 virtio_cread8(struct virtio_device *vdev, unsigned int offset) { - u8 ret; + u8 ret = 0; vdev->config->get(vdev, offset, &ret, sizeof(ret)); return ret; } @@ -348,7 +348,7 @@ static inline void virtio_cwrite8(struct virtio_device *vdev, static inline u16 virtio_cread16(struct virtio_device *vdev, unsigned int offset) { - u16 ret; + u16 ret = 0; vdev->config->get(vdev, offset, &ret, sizeof(ret)); return virtio16_to_cpu(vdev, (__force __virtio16)ret); } @@ -363,7 +363,7 @@ static in...
2017 Jul 03
2
[PATCH v1] virtio_blk: Use sysfs_match_string() helper
...Y_SIZE(virtblk_cache_types); --i >= 0; ) > > - if (sysfs_streq(buf, virtblk_cache_types[i])) > > - break; > > - > > + i = sysfs_match_string(virtblk_cache_types, buf); > > ? if (i < 0) > > - return -EINVAL; > > + return i; > > ? > > ? virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce), > > i); > > ? virtblk_update_cache_mode(vdev); > > -- > Andy Shevchenko <andriy.shevchenko at linux.intel.com> > Intel Finland Oy
2014 Dec 11
0
[PATCH 2/3] virtio_config: fix virtio_cread_bytes
...ne void virtio_cread_bytes(struct virtio_device *vdev, unsigned int offset, void *buf, size_t len) { - vdev->config->get(vdev, offset, buf, len); + int i; + + for (i = 0; i < len; i++) + vdev->config->get(vdev, offset + i, buf + i, 1); } static inline void virtio_cwrite8(struct virtio_device *vdev, -- MST
2014 Dec 15
0
[PATCH 6/6] virtio: core support for config generation
...ine void virtio_cread_bytes(struct virtio_device *vdev, unsigned int offset, void *buf, size_t len) { - int i; - - for (i = 0; i < len; i++) - vdev->config->get(vdev, offset + i, buf + i, 1); + __virtio_cread_many(vdev, offset, buf, len, 1); } static inline void virtio_cwrite8(struct virtio_device *vdev, @@ -352,6 +375,7 @@ static inline u64 virtio_cread64(struct virtio_device *vdev, { u64 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); + __virtio_cread_many(vdev, offset, &ret, 1, sizeof(ret)); return virtio64_to_cpu(vdev, (__force __virtio6...
2014 Dec 15
0
[PATCH 6/6] virtio: core support for config generation
...ine void virtio_cread_bytes(struct virtio_device *vdev, unsigned int offset, void *buf, size_t len) { - int i; - - for (i = 0; i < len; i++) - vdev->config->get(vdev, offset + i, buf + i, 1); + __virtio_cread_many(vdev, offset, buf, len, 1); } static inline void virtio_cwrite8(struct virtio_device *vdev, @@ -352,6 +375,7 @@ static inline u64 virtio_cread64(struct virtio_device *vdev, { u64 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); + __virtio_cread_many(vdev, offset, &ret, 1, sizeof(ret)); return virtio64_to_cpu(vdev, (__force __virtio6...
2014 Dec 11
4
[PATCH 0/3] minor virtio 1.0 fixups
Here are some fixup patches on top of my latest pull request. Will include in the next pull request. Michael S. Tsirkin (3): virtio: set VIRTIO_CONFIG_S_FEATURES_OK on restore virtio_config: fix virtio_cread_bytes virtio_pci_common.h: drop VIRTIO_PCI_NO_LEGACY drivers/virtio/virtio_pci_common.h | 1 - include/linux/virtio_config.h | 5 ++++- drivers/virtio/virtio.c | 37
2014 Dec 11
4
[PATCH 0/3] minor virtio 1.0 fixups
Here are some fixup patches on top of my latest pull request. Will include in the next pull request. Michael S. Tsirkin (3): virtio: set VIRTIO_CONFIG_S_FEATURES_OK on restore virtio_config: fix virtio_cread_bytes virtio_pci_common.h: drop VIRTIO_PCI_NO_LEGACY drivers/virtio/virtio_pci_common.h | 1 - include/linux/virtio_config.h | 5 ++++- drivers/virtio/virtio.c | 37
2020 Aug 05
0
[PATCH v3 24/38] virtio_config: rewrite using _Generic
...and be integer */ \ - if (!__virtio_typecheck(structname, member, *(ptr))) \ - BUG_ON((*ptr) == 1); \ + typeof(((structname*)0)->member) virtio_cwrite_v = \ + cpu_to_virtio(vdev, *(ptr), ((structname*)0)->member); \ \ - switch (sizeof(*ptr)) { \ - case 1: \ - virtio_cwrite8(vdev, \ - offsetof(structname, member), \ - *(ptr)); \ - break; \ - case 2: \ - virtio_cwrite16(vdev, \ - offsetof(structname, member), \ - *(ptr)); \ - break; \ - case 4: \ - virtio_cwrite32(vdev, \ - offsetof(structname...
2013 Apr 05
8
[PATCH 0/7] virtio cleanups
Aiming these for coming merge window. Nothing should change, but get ready for a non-guest-endian config transports, and > 32 features bits. Final one is just an overdue consolidation. Cheers, Rusty. Rusty Russell (7): virtio_config: introduce size-based accessors. virtio: use size-based config accessors. virtio_config: helpers for non-converting accessors. virtio_config: make