Skip to contentSkip to conversation

virtio-mem: Assign boolean values to a bool variable

PATCH In review Jiapeng Zhong 3 participants 8 messages Jan 20, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-mem: Assign boolean values to a bool variable

Fix the following coccicheck warnings:

./drivers/virtio/virtio_mem.c:2580:2-25: WARNING: Assignment of 0/1 to bool variable.

---
 drivers/virtio/virtio_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/virtio/virtio_mem.c +1 -1
index 9fc9ec4..85a272c 100644
@@ -2577,7 +2577,7 @@ static int virtio_mem_probe(struct virtio_device *vdev)
 	 * actually in use (e.g., trying to reload the driver).
 	 */
 	if (vm->plugged_size) {
-		vm->unplug_all_required = 1;
+		vm->unplug_all_required = true;
 		dev_info(&vm->vdev->dev, "unplugging all memory is required\n");
 	}
 
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 17 lines · Jiapeng Zhong

Fix the following coccicheck warnings:

./drivers/virtio/virtio_mem.c:2580:2-25: WARNING: Assignment of 0/1 to bool variable.

---
 drivers/virtio/virtio_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/virtio/virtio_mem.c +0 -0
index 9fc9ec4..85a272c 100644

drivers/virtio/virtio_mem.c static int virtio_mem_probe(struct virtio_device *vdev) · line 2583

Quoted 8 lines
drivers/virtio/virtio_mem.c +1 -1
@@ -2577,7 +2577,7 @@ static int virtio_mem_probe(struct virtio_device *vdev)
 	 * actually in use (e.g., trying to reload the driver).
 	 */
 	if (vm->plugged_size) {
-		vm->unplug_all_required = 1;
+		vm->unplug_all_required = true;
 		dev_info(&vm->vdev->dev, "unplugging all memory is required\n");
 	}
 

Hi,

we already had a fix on the list for quite a while:

https://lkml.kernel.org/r/[email protected]

However, looks like Michael queued your patch on the vhost tree instead.

Signature · 8 lines
Thanks,

David / dhildenb

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#2 lore raw
Quoted 29 lines · David Hildenbrand
Quoted 17 lines · Jiapeng Zhong

Fix the following coccicheck warnings:

./drivers/virtio/virtio_mem.c:2580:2-25: WARNING: Assignment of 0/1 to bool variable.

---
 drivers/virtio/virtio_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/virtio/virtio_mem.c +0 -0
index 9fc9ec4..85a272c 100644

drivers/virtio/virtio_mem.c static int virtio_mem_probe(struct virtio_device *vdev) · line 2583

Quoted 8 lines
drivers/virtio/virtio_mem.c +1 -1
@@ -2577,7 +2577,7 @@ static int virtio_mem_probe(struct virtio_device *vdev)
 	 * actually in use (e.g., trying to reload the driver).
 	 */
 	if (vm->plugged_size) {
-		vm->unplug_all_required = 1;
+		vm->unplug_all_required = true;
 		dev_info(&vm->vdev->dev, "unplugging all memory is required\n");
 	}
 

Hi,

Quoted 3 lines

we already had a fix on the list for quite a while:

https://lkml.kernel.org/r/[email protected]

Can't find that one.

Quoted 6 lines

However, looks like Michael queued your patch on the vhost tree instead.

Signature · 3 lines
Thanks,

David / dhildenb

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#3 lore raw
Quoted 30 lines · Michael S. Tsirkin
Quoted 29 lines · David Hildenbrand
Quoted 17 lines · Jiapeng Zhong

Fix the following coccicheck warnings:

./drivers/virtio/virtio_mem.c:2580:2-25: WARNING: Assignment of 0/1 to bool variable.

---
 drivers/virtio/virtio_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/virtio/virtio_mem.c +0 -0
index 9fc9ec4..85a272c 100644

drivers/virtio/virtio_mem.c static int virtio_mem_probe(struct virtio_device *vdev) · line 2583

Quoted 8 lines
drivers/virtio/virtio_mem.c +1 -1
@@ -2577,7 +2577,7 @@ static int virtio_mem_probe(struct virtio_device *vdev)
 	 * actually in use (e.g., trying to reload the driver).
 	 */
 	if (vm->plugged_size) {
-		vm->unplug_all_required = 1;
+		vm->unplug_all_required = true;
 		dev_info(&vm->vdev->dev, "unplugging all memory is required\n");
 	}
 

Hi,

Quoted 5 lines
Quoted 3 lines

we already had a fix on the list for quite a while:

https://lkml.kernel.org/r/[email protected]

Can't find that one.

Looks like it was only on virtualization@ and a couple of people on cc.

https://lists.linuxfoundation.org/pipermail/virtualization/2020-December/051662.html

Interestingly, I cannot find the follow-up ("[PATCH] virtio-mem: use boolean value when setting vm->unplug_all_required") in the mailing list archives, even though it has virtualization@ on cc.

Signature · 8 lines
Thanks,

David / dhildenb

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#4 lore raw
Quoted 37 lines · David Hildenbrand
Quoted 30 lines · Michael S. Tsirkin
Quoted 29 lines · David Hildenbrand
Quoted 17 lines · Jiapeng Zhong

Fix the following coccicheck warnings:

./drivers/virtio/virtio_mem.c:2580:2-25: WARNING: Assignment of 0/1 to bool variable.

---
 drivers/virtio/virtio_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/virtio/virtio_mem.c +0 -0
index 9fc9ec4..85a272c 100644

drivers/virtio/virtio_mem.c static int virtio_mem_probe(struct virtio_device *vdev) · line 2583

Quoted 8 lines
drivers/virtio/virtio_mem.c +1 -1
@@ -2577,7 +2577,7 @@ static int virtio_mem_probe(struct virtio_device *vdev)
 	 * actually in use (e.g., trying to reload the driver).
 	 */
 	if (vm->plugged_size) {
-		vm->unplug_all_required = 1;
+		vm->unplug_all_required = true;
 		dev_info(&vm->vdev->dev, "unplugging all memory is required\n");
 	}
 

Hi,

Quoted 5 lines
Quoted 3 lines

we already had a fix on the list for quite a while:

https://lkml.kernel.org/r/[email protected]

Can't find that one.

Quoted 7 lines

Looks like it was only on virtualization@ and a couple of people on cc.

https://lists.linuxfoundation.org/pipermail/virtualization/2020-December/051662.html

Interestingly, I cannot find the follow-up ("[PATCH] virtio-mem: use boolean value when setting vm->unplug_all_required") in the mailing list archives, even though it has virtualization@ on cc.

Unsurprising that I didn't merge it then ;)
Want to send your ack on this one?

Quoted 4 lines
Signature · 3 lines
Thanks,

David / dhildenb

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#5 lore raw
Quoted 40 lines · Michael S. Tsirkin
Quoted 39 lines · David Hildenbrand
Quoted 30 lines · Michael S. Tsirkin
Quoted 29 lines · David Hildenbrand
Quoted 17 lines · Jiapeng Zhong

Fix the following coccicheck warnings:

./drivers/virtio/virtio_mem.c:2580:2-25: WARNING: Assignment of 0/1 to bool variable.

---
 drivers/virtio/virtio_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/virtio/virtio_mem.c +0 -0
index 9fc9ec4..85a272c 100644

drivers/virtio/virtio_mem.c static int virtio_mem_probe(struct virtio_device *vdev) · line 2583

Quoted 8 lines
drivers/virtio/virtio_mem.c +1 -1
@@ -2577,7 +2577,7 @@ static int virtio_mem_probe(struct virtio_device *vdev)
 	 * actually in use (e.g., trying to reload the driver).
 	 */
 	if (vm->plugged_size) {
-		vm->unplug_all_required = 1;
+		vm->unplug_all_required = true;
 		dev_info(&vm->vdev->dev, "unplugging all memory is required\n");
 	}
 

Hi,

Quoted 5 lines
Quoted 3 lines

we already had a fix on the list for quite a while:

https://lkml.kernel.org/r/[email protected]

Can't find that one.

Looks like it was only on virtualization@ and a couple of people on cc.

Quoted 8 lines
Quoted 5 lines

https://lists.linuxfoundation.org/pipermail/virtualization/2020-December/051662.html

Interestingly, I cannot find the follow-up ("[PATCH] virtio-mem: use boolean value when setting vm->unplug_all_required") in the mailing list archives, even though it has virtualization@ on cc.

Unsurprising that I didn't merge it then ;)

Well, you were on cc ;)

Quoted 1 line

Want to send your ack on this one?

Sure

Signature · 8 lines
Thanks,

David / dhildenb

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
#6 lore raw
Quoted 43 lines · David Hildenbrand
Quoted 42 lines · Michael S. Tsirkin
Quoted 41 lines · David Hildenbrand
Quoted 30 lines · Michael S. Tsirkin
Quoted 29 lines · David Hildenbrand
Quoted 17 lines · Jiapeng Zhong

Fix the following coccicheck warnings:

./drivers/virtio/virtio_mem.c:2580:2-25: WARNING: Assignment of 0/1 to bool variable.

---
 drivers/virtio/virtio_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/virtio/virtio_mem.c +0 -0
index 9fc9ec4..85a272c 100644

drivers/virtio/virtio_mem.c static int virtio_mem_probe(struct virtio_device *vdev) · line 2583

Quoted 8 lines
drivers/virtio/virtio_mem.c +1 -1
@@ -2577,7 +2577,7 @@ static int virtio_mem_probe(struct virtio_device *vdev)
 	 * actually in use (e.g., trying to reload the driver).
 	 */
 	if (vm->plugged_size) {
-		vm->unplug_all_required = 1;
+		vm->unplug_all_required = true;
 		dev_info(&vm->vdev->dev, "unplugging all memory is required\n");
 	}
 

Hi,

Quoted 5 lines
Quoted 3 lines

we already had a fix on the list for quite a while:

https://lkml.kernel.org/r/[email protected]

Can't find that one.

Looks like it was only on virtualization@ and a couple of people on cc.

https://lists.linuxfoundation.org/pipermail/virtualization/2020-December/051662.html

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Interestingly, I cannot find the follow-up ("[PATCH] virtio-mem: use boolean value when setting vm->unplug_all_required") in the mailing list archives, even though it has virtualization@ on cc.

Unsurprising that I didn't merge it then ;)

Well, you were on cc ;)

Hmm true. Found it now.

Quoted 5 lines
Quoted 1 line

Want to send your ack on this one?

Sure

Added yours and the original Signed-off-by.

Thanks!

Quoted 5 lines
Signature · 4 lines
-- 
Thanks,

David / dhildenb

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#7 lore raw
Quoted 10 lines
Quoted 5 lines
Quoted 1 line

Want to send your ack on this one?

Sure

Added yours and the original Signed-off-by.

Thanks!

Thanks Michael!

Signature · 8 lines
Thanks,

David / dhildenb

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization