Linux Kernels

s390/virtio: change virtio_feature_desc:features type to __le32

This change “s390/virtio: change virtio_feature_desc:features type to __le32” (commit fb31700) in Linux kernel is authored by Heiko Carstens <heiko.carstens [at] de.ibm.com> on Tue May 9 12:50:53 2017 +0200.

Description of "s390/virtio: change virtio_feature_desc:features type to __le32"

The change “s390/virtio: change virtio_feature_desc:features type to le32” introduces changes as follows. <file> s390/virtio: change virtio_feature_desc:features type to le32

The feature member of virtio_feature_desc contains little endian values, given that it contents will be converted with le32_to_cpu(). The “wrong” u32 type leads to the sparse warnings below. In order to avoid them, use the correct le32 type instead.

drivers/s390/virtio/virtio_ccw.c:749:14: warning: cast to restricted le32 drivers/s390/virtio/virtio_ccw.c:762:28: warning: cast to restricted le32

Acked-by: Halil Pasic pasic@linux.vnet.ibm.com Acked-by: Cornelia Huck cornelia.huck@de.ibm.com Signed-off-by: Heiko Carstens heiko.carstens@de.ibm.com Signed-off-by: Martin Schwidefsky schwidefsky@de.ibm.com </file>

Linux kernel releases containing commit fb31700

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "s390/virtio: change virtio_feature_desc:features type to __le32"

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/s390/virtio/virtio_ccw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 
diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c
index 0ed209f3d8b0..c7d4ef7b4b22 100644
--- a/drivers/s390/virtio/virtio_ccw.c
+++ b/drivers/s390/virtio/virtio_ccw.c
@@ -87,7 +87,7 @@ struct vq_info_block {
 } __packed;
 
 struct virtio_feature_desc {
-	__u32 features;
+	__le32 features;
 	__u8 index;
 } __packed;
 

The commit for this change in Linux stable tree is fb31700 (patch).

Last modified: 2020/01/11 06:57