Miscellaneous patches for 2018-06-13
The following changes since commit 2ab09bf2f9f55b9fb8d2de6eb2ba2a8570e268e2:
Merge remote-tracking branch 'remotes/kraxel/tags/usb-20180612-pull-request' into staging (2018-06-12 15:34:34 +0100)
are available in the Git repository at:
git://repo.or.cz/qemu/armbru.git tags/pull-misc-2018-06-13
for you to fetch changes up to 719a30776b94d3da8c613e5047414f483d40256d:
Purge uses of banned g_assert_FOO() (2018-06-13 13:47:35 +0200)
----------------------------------------------------------------
Miscellaneous patches for 2018-06-13
----------------------------------------------------------------
Markus Armbruster (2):
Revert "Makefile: add target to print generated files" Purge uses of banned g_assert_FOO()
Paolo Bonzini (1):
coverity-model: replay data is considered trusted
Makefile | 3 --- hw/ide/ahci.c | 2 +- hw/ppc/spapr_ovec.c | 12 ++++++------ hw/usb/dev-smartcard-reader.c | 2 +- qom/object.c | 10 +++++----- scripts/coverity-model.c | 12 ++++++++++++ util/qht.c | 2 +- 7 files changed, 26 insertions(+), 17 deletions(-)
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 1/3] Revert "Makefile: add target to print generated files"
This reverts commit 9578f8cc3e8bd71de8e3f543dc7b95644d64824e.
The patch snuck in by accident without having been posted to qemu-devel. It's entirely redundant: existing target print-% already serves the purpose.
Message-Id: <[email protected]>
--- Makefile | 3 --- 1 file changed, 3 deletions(-)
Makefile +0 -3
@@ -1055,9 +1055,6 @@ endif include $(SRC_PATH)/tests/docker/Makefile.include include $(SRC_PATH)/tests/vm/Makefile.include -printgen: - @echo $(GENERATED_FILES) - .PHONY: help help: @echo 'Generic targets:'
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 2/3] coverity-model: replay data is considered trusted
In reply to Markus ArmbrusterFrom: Paolo Bonzini <[email protected]>
Replay data is not considered a possible attack vector; add a model that does not use getc so that "tainted data" warnings are suppressed.
Message-Id: <[email protected]>
--- scripts/coverity-model.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
scripts/coverity-model.c +12 -0
@@ -103,6 +103,18 @@ static int get_keysym(const name2keysym_t *table, } } +/* Replay data is considered trusted. */ +uint8_t replay_get_byte (void ) +{ +uint8_t byte =0 ; +if (replay_file) { +uint8_t c; + byte = c; + } +return byte; +} + +/* * GLib memory allocation functions. *
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 3/3] Purge uses of banned g_assert_FOO()
In reply to Markus ArmbrusterWe banned use of certain g_assert_FOO() functions outside tests, and made checkpatch.pl flag them (commit 6e9389563e5). We neglected to purge existing uses. Do that now.
Message-Id: <[email protected]>
--- hw/ide/ahci.c | 2 +- hw/ppc/spapr_ovec.c | 12 ++++++------ hw/usb/dev-smartcard-reader.c | 2 +- qom/object.c | 10 +++++----- util/qht.c | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-)
hw/ide/ahci.c +1 -1
@@ -440,7 +440,7 @@ static uint64_t ahci_mem_read(void *opaque, hwaddr addr, unsigned size)if (ofst + size <=4 ) { val = lo >> (ofst *8 ); }else { - g_assert_cmpint(size, >, 1); +g_assert (size >1 );/* If the 64bit read is unaligned, we will produce undefined * results. AHCI does not support unaligned 64bit reads. */
hw/ppc/spapr_ovec.c +6 -6
@@ -113,7 +113,7 @@ void spapr_ovec_cleanup(sPAPROptionVector *ov)void spapr_ovec_set (sPAPROptionVector *ov,long bitnr) {g_assert (ov); - g_assert_cmpint(bitnr, <, OV_MAXBITS); +g_assert (bitnr <OV_MAXBITS );set_bit (bitnr, ov->bitmap); }
@@ -121,7 +121,7 @@ void spapr_ovec_set(sPAPROptionVector *ov, long bitnr)void spapr_ovec_clear (sPAPROptionVector *ov,long bitnr) {g_assert (ov); - g_assert_cmpint(bitnr, <, OV_MAXBITS); +g_assert (bitnr <OV_MAXBITS );clear_bit (bitnr, ov->bitmap); }
@@ -129,7 +129,7 @@ void spapr_ovec_clear(sPAPROptionVector *ov, long bitnr)bool spapr_ovec_test (sPAPROptionVector *ov,long bitnr) {g_assert (ov); - g_assert_cmpint(bitnr, <, OV_MAXBITS); +g_assert (bitnr <OV_MAXBITS );return test_bit (bitnr, ov->bitmap) ? true : false; }
@@ -186,7 +186,7 @@ sPAPROptionVector *spapr_ovec_parse_vector(target_ulong table_addr, int vector)int i;g_assert (table_addr); - g_assert_cmpint(vector, >=, 1); /* vector numbering starts at 1 */ +g_assert (vector >=1 );/* vector numbering starts at 1 */ addr =vector_addr (table_addr, vector);if (!addr) {
@@ -195,7 +195,7 @@ sPAPROptionVector *spapr_ovec_parse_vector(target_ulong table_addr, int vector) } vector_len =ldub_phys (&address_space_memory, addr++) +1 ; - g_assert_cmpint(vector_len, <=, OV_MAXBYTES); +g_assert (vector_len <=OV_MAXBYTES ); ov =spapr_ovec_new ();for (i =0 ; i < vector_len; i++) {
@@ -225,7 +225,7 @@ int spapr_ovec_populate_dt(void *fdt, int fdt_offset,* encoding/sizing expected in ibm,client-architecture-support */ vec_len = (lastbit ==OV_MAXBITS ) ?1 : lastbit /BITS_PER_BYTE +1 ; - g_assert_cmpint(vec_len, <=, OV_MAXBYTES); +g_assert (vec_len <=OV_MAXBYTES );/* guest expects vector len encoded as vec_len - 1, since the length byte * is assumed and not included, and the first byte of the vector * is assumed as well
hw/usb/dev-smartcard-reader.c +1 -1
@@ -786,7 +786,7 @@ static void ccid_write_data_block(USBCCIDState *s, uint8_t slot, uint8_t seq,DPRINTF (s,D_VERBOSE ,"error %d\n" , p->b.bError); }if (len) { -g_assert_nonnull (data); +assert (data);memcpy (p->abData, data, len); }ccid_reset_error_status (s);
qom/object.c +5 -5
@@ -295,7 +295,7 @@ static void type_initialize(TypeImpl *ti)GSList *e;int i; - g_assert_cmpint(parent->class_size, <=, ti->class_size); +g_assert (parent->class_size <= ti->class_size);memcpy (ti->class, parent->class, parent->class_size); ti->class->interfaces =NULL ; ti->class->properties = g_hash_table_new_full(
@@ -372,9 +372,9 @@ static void object_initialize_with_type(void *data, size_t size, TypeImpl *type)g_assert (type !=NULL );type_initialize (type); - g_assert_cmpint(type->instance_size, >=, sizeof(Object)); +g_assert (type->instance_size >=sizeof (Object));g_assert (type->abstract == false); - g_assert_cmpint(size, >=, type->instance_size); +g_assert (size >= type->instance_size);memset (obj,0 , type->instance_size); obj->class = type->class;
@@ -475,7 +475,7 @@ static void object_finalize(void *data)object_property_del_all (obj);object_deinit (obj, ti); - g_assert_cmpint(obj->ref, ==, 0); +g_assert (obj->ref ==0 );if (obj->free) { obj->free (obj); }
@@ -917,7 +917,7 @@ void object_unref(Object *obj)if (!obj) {return ; } - g_assert_cmpint(obj->ref, >, 0); +g_assert (obj->ref >0 );/* parent always holds a reference to its children */ if (atomic_fetch_dec (&obj->ref) ==1 ) {
util/qht.c +1 -1
@@ -759,7 +759,7 @@ static void qht_do_resize_reset(struct qht *ht, struct qht_map *new, bool reset)return ; } - g_assert_cmpuint(new->n_buckets, !=, old->n_buckets); +g_assert (new->n_buckets != old->n_buckets);qht_map_iter__all_locked (ht, old, qht_map_copy, new);qht_map_debug__all_locked (new);
Signature · 1 line
2.17.1
This series seems to have some coding style problems. See output below for more information:
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PULL 0/3] Miscellaneous patches for 2018-06-13
=== TEST SCRIPT BEGIN ===
#!/bin/bash
BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
commits="$(git log --format=%H --reverse $BASE..)" for c in $commits; do
echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
failed=1
echo
fi
n=$((n+1))done
exit $failed
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 Switched to a new branch 'test'5cb103bc21 Purge uses of banned g_assert_FOO() 3aa2ecc4d4 coverity-model: replay data is considered trusted 572b561a1a Revert "Makefile: add target to print generated files"
=== OUTPUT BEGIN ===
Checking PATCH 1/3: Revert "Makefile: add target to print generated files"... Checking PATCH 2/3: coverity-model: replay data is considered trusted...
ERROR: suspect code indent for conditional statements (5, 9)
#28: FILE: scripts/coverity-model.c:110:
+ if (replay_file) {
+ uint8_t c;
total: 1 errors, 0 warnings, 18 lines checked
Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
Checking PATCH 3/3: Purge uses of banned g_assert_FOO()... === OUTPUT END ===
Test command exited with code: 1
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]
Peter Maydell
AppliedQuoted 15 lines · Markus Armbruster
The following changes since commit
2ab09bf2f9f55b9fb8d2de6eb2ba2a8570e268e2:Merge remote-tracking branch 'remotes/kraxel/tags/usb-20180612-pull-request' into staging (2018-06-12 15:34:34 +0100)
are available in the Git repository at:
git://repo.or.cz/qemu/armbru.gittags/pull-misc-2018-06-13for you to fetch changes up to
719a30776b94d3da8c613e5047414f483d40256d:Purge uses of banned
g_assert_FOO()(2018-06-13 13:47:35 +0200)----------------------------------------------------------------
Miscellaneous patches for 2018-06-13
Quoted 8 lines
----------------------------------------------------------------
Markus Armbruster (2):
Revert "Makefile: add target to print generated files" Purge uses of bannedg_assert_FOO()Paolo Bonzini (1):
coverity-model: replay data is considered trusted
Applied, thanks.
-- PMM
Quoted 4 lines · [email protected] writes:
Hi,
This series seems to have some coding style problems. See output below for more information:
Quick respin coming.