aboutsummaryrefslogtreecommitdiff
path: root/include/hw/qdev-core.h
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2024-10-10 17:01:41 +0200
committerMarkus Armbruster <armbru@redhat.com>2024-10-18 15:03:35 +0200
commitf91cf8175bd40142a2dfddbd8e761b8ca1adc30f (patch)
treee7e2dbda56b8175007416b4299cd1161a259cb6a /include/hw/qdev-core.h
parent5551449bb8e58d0dacb43b3d436b201b28324ee9 (diff)
downloadqemu-f91cf8175bd40142a2dfddbd8e761b8ca1adc30f.zip
qemu-f91cf8175bd40142a2dfddbd8e761b8ca1adc30f.tar.gz
qemu-f91cf8175bd40142a2dfddbd8e761b8ca1adc30f.tar.bz2
target/i386/cpu: Avoid mixing signed and unsigned in property setters
Properties "family", "model", and "stepping" are visited as signed integers. They are backed by bits in CPUX86State member @cpuid_version. The code to extract and insert these bits mixes signed and unsigned. Not actually wrong, but avoiding such mixing is good practice. Visit them as unsigned integers instead. This adds a few mildly ugly cast in arguments of error_setg(). The next commit will get rid of them again. Property "tsc-frequency" is also visited as signed integer. The value ultimately flows into the kernel, where it is 31 bits unsigned. The QEMU code freely mixes int, uint32_t, int64_t. I elect not to attempt draining this swamp today. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20241010150144.986655-5-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Diffstat (limited to 'include/hw/qdev-core.h')
0 files changed, 0 insertions, 0 deletions