Re: [kvm-unit-tests PATCH 3/5] lib: s390x: uv: Int type cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/07/2021 11.33, Janosch Frank wrote:
On 7/4/21 9:51 AM, Thomas Huth wrote:
On 29/06/2021 15.33, Janosch Frank wrote:
These structs have largely been copied from the kernel so they still
have the old uint short types which we want to avoid in favor of the
uint*_t ones.

Signed-off-by: Janosch Frank <frankja@xxxxxxxxxxxxx>
---
   lib/s390x/asm/uv.h | 142 +++++++++++++++++++++++----------------------
   1 file changed, 72 insertions(+), 70 deletions(-)

diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h
index dc3e02d..96a2a7e 100644
--- a/lib/s390x/asm/uv.h
+++ b/lib/s390x/asm/uv.h
@@ -12,6 +12,8 @@
   #ifndef _ASMS390X_UV_H_
   #define _ASMS390X_UV_H_
+#include <stdint.h>
+
   #define UVC_RC_EXECUTED		0x0001
   #define UVC_RC_INV_CMD		0x0002
   #define UVC_RC_INV_STATE	0x0003
@@ -68,73 +70,73 @@ enum uv_cmds_inst {
   };
struct uv_cb_header {
-	u16 len;
-	u16 cmd;	/* Command Code */
-	u16 rc;		/* Response Code */
-	u16 rrc;	/* Return Reason Code */
+	uint16_t len;
+	uint16_t cmd;	/* Command Code */
+	uint16_t rc;	/* Response Code */
+	uint16_t rrc;	/* Return Reason Code */
   } __attribute__((packed))  __attribute__((aligned(8)));

Hmm, for files that are more or less a copy from the corresponding kernel
header, I'm not sure whether it makes sense to convert them to the stdint.h
types? It might be better to keep the kernel types so that updates to this
header can be ported more easily to the kvm-unit-tests later?

sie.h contents are 90% sblk which came directly from KVM...
Do you really want to have exceptions for one file? Because if that's
the case then I see no sense in changing other things over since I
prefer using short types.

Completely inaccurate checks with the lib directory of the kvm-unit-tests:

$ grep -r u64 lib/ | wc -l
234
$ grep -r uint64 lib/ | wc -l
245

$ grep -r u8 lib/ | wc -l
137
$ grep -r uint8 lib/ | wc -l
193

... I guess that's an indication that we do not really have a prevailing style here? I personally prefer the stdint.h types, I'm just not sure whether it makes sense to keep some headers close to the kernel or not...?

 Thomas




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux