* [PATCH] virtio_blk: mark all zone fields LE
@ 2022-12-22 19:32 Michael S. Tsirkin
2022-12-23 2:23 ` Chaitanya Kulkarni
2022-12-23 6:28 ` Jason Wang
0 siblings, 2 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2022-12-22 19:32 UTC (permalink / raw)
To: linux-kernel; +Cc: Jason Wang, Paolo Bonzini, Stefan Hajnoczi, virtualization
zone is a virtio 1.x feature so all fields are LE,
they are handled as such, but have mistakenly been labeled
__virtioXX in the header. This results in a bunch of sparse warnings.
Use the __leXX tags to make sparse happy.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
include/uapi/linux/virtio_blk.h | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/include/uapi/linux/virtio_blk.h b/include/uapi/linux/virtio_blk.h
index f4d5ee7c6f30..ec3c3779406f 100644
--- a/include/uapi/linux/virtio_blk.h
+++ b/include/uapi/linux/virtio_blk.h
@@ -141,11 +141,11 @@ struct virtio_blk_config {
/* Zoned block device characteristics (if VIRTIO_BLK_F_ZONED) */
struct virtio_blk_zoned_characteristics {
- __virtio32 zone_sectors;
- __virtio32 max_open_zones;
- __virtio32 max_active_zones;
- __virtio32 max_append_sectors;
- __virtio32 write_granularity;
+ __le32 zone_sectors;
+ __le32 max_open_zones;
+ __le32 max_active_zones;
+ __le32 max_append_sectors;
+ __le32 write_granularity;
__u8 model;
__u8 unused2[3];
} zoned;
@@ -245,11 +245,11 @@ struct virtio_blk_outhdr {
*/
struct virtio_blk_zone_descriptor {
/* Zone capacity */
- __virtio64 z_cap;
+ __le64 z_cap;
/* The starting sector of the zone */
- __virtio64 z_start;
+ __le64 z_start;
/* Zone write pointer position in sectors */
- __virtio64 z_wp;
+ __le64 z_wp;
/* Zone type */
__u8 z_type;
/* Zone state */
@@ -258,7 +258,7 @@ struct virtio_blk_zone_descriptor {
};
struct virtio_blk_zone_report {
- __virtio64 nr_zones;
+ __le64 nr_zones;
__u8 reserved[56];
struct virtio_blk_zone_descriptor zones[];
};
--
MST
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] virtio_blk: mark all zone fields LE
2022-12-22 19:32 [PATCH] virtio_blk: mark all zone fields LE Michael S. Tsirkin
@ 2022-12-23 2:23 ` Chaitanya Kulkarni
2022-12-23 6:28 ` Jason Wang
1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2022-12-23 2:23 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: linux-kernel, Paolo Bonzini, Stefan Hajnoczi, virtualization
>
> On Dec 22, 2022, at 11:32 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
>
> zone is a virtio 1.x feature so all fields are LE,
> they are handled as such, but have mistakenly been labeled
> __virtioXX in the header. This results in a bunch of sparse warnings.
>
> Use the __leXX tags to make sparse happy.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>
Every field from spec should reflect endianness from spec...
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] virtio_blk: mark all zone fields LE
2022-12-22 19:32 [PATCH] virtio_blk: mark all zone fields LE Michael S. Tsirkin
2022-12-23 2:23 ` Chaitanya Kulkarni
@ 2022-12-23 6:28 ` Jason Wang
1 sibling, 0 replies; 3+ messages in thread
From: Jason Wang @ 2022-12-23 6:28 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: linux-kernel, Paolo Bonzini, Stefan Hajnoczi, virtualization
On Fri, Dec 23, 2022 at 3:32 AM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> zone is a virtio 1.x feature so all fields are LE,
> they are handled as such, but have mistakenly been labeled
> __virtioXX in the header. This results in a bunch of sparse warnings.
>
> Use the __leXX tags to make sparse happy.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Thanks
> ---
> include/uapi/linux/virtio_blk.h | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/include/uapi/linux/virtio_blk.h b/include/uapi/linux/virtio_blk.h
> index f4d5ee7c6f30..ec3c3779406f 100644
> --- a/include/uapi/linux/virtio_blk.h
> +++ b/include/uapi/linux/virtio_blk.h
> @@ -141,11 +141,11 @@ struct virtio_blk_config {
>
> /* Zoned block device characteristics (if VIRTIO_BLK_F_ZONED) */
> struct virtio_blk_zoned_characteristics {
> - __virtio32 zone_sectors;
> - __virtio32 max_open_zones;
> - __virtio32 max_active_zones;
> - __virtio32 max_append_sectors;
> - __virtio32 write_granularity;
> + __le32 zone_sectors;
> + __le32 max_open_zones;
> + __le32 max_active_zones;
> + __le32 max_append_sectors;
> + __le32 write_granularity;
> __u8 model;
> __u8 unused2[3];
> } zoned;
> @@ -245,11 +245,11 @@ struct virtio_blk_outhdr {
> */
> struct virtio_blk_zone_descriptor {
> /* Zone capacity */
> - __virtio64 z_cap;
> + __le64 z_cap;
> /* The starting sector of the zone */
> - __virtio64 z_start;
> + __le64 z_start;
> /* Zone write pointer position in sectors */
> - __virtio64 z_wp;
> + __le64 z_wp;
> /* Zone type */
> __u8 z_type;
> /* Zone state */
> @@ -258,7 +258,7 @@ struct virtio_blk_zone_descriptor {
> };
>
> struct virtio_blk_zone_report {
> - __virtio64 nr_zones;
> + __le64 nr_zones;
> __u8 reserved[56];
> struct virtio_blk_zone_descriptor zones[];
> };
> --
> MST
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-23 6:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-22 19:32 [PATCH] virtio_blk: mark all zone fields LE Michael S. Tsirkin
2022-12-23 2:23 ` Chaitanya Kulkarni
2022-12-23 6:28 ` Jason Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®