Skip to contentSkip to conversation

Various small fixes

PATCH In review Thomas Wood 2 participants 6 messages Feb 7, 2014 – Feb 10, 2014

lore
Share & tools
lore
#0 lore raw

cover Various small fixes

The following patches fix various issues in intel-gpu-tools that were found by static analysis and compiler warnings.

Thomas Wood (3):
debugger: fix the -p option
assembler: fix condition for printing a warning tests/gem_seqno_wrap: fix over allocation of buffers

 assembler/gram.y       | 2 +-
 debugger/eudb.c        | 2 +-
 tests/gem_seqno_wrap.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
1.8.5.3
#1 lore raw

PATCH 1/3 debugger: fix the -p option

---
 debugger/eudb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
debugger/eudb.c +1 -1
index ff77e42..4cbc2d7 100644
@@ -538,7 +538,7 @@ int main(int argc, char* argv[]) {
 	}
 
 	pci_dev = intel_get_pci_device();
-	if (devid != -1);
+	if (devid == -1)
 		devid = pci_dev->device_id;
 	if (identify_device(devid)) {
 		abort();
Signature · 1 line
1.8.5.3
#2 lore raw

PATCH 2/3 assembler: fix condition for printing a warning

In reply to Thomas Wood
---
 assembler/gram.y | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
assembler/gram.y +1 -1
index ad4cb29..f4145bd 100644
@@ -351,7 +351,7 @@ static bool validate_src_reg(struct brw_program_instruction *insn,
     /* B. If ExecSize = Width and HorzStride ≠ 0, VertStride must be set to
      * Width * HorzStride. */
     if (execsize == width && hstride != 0) {
-	if (vstride != -1 && vstride != width * hstride);
+	if (vstride != -1 && vstride != width * hstride)
 	    warn(ALL, location, "execution size == width and hstride != 0 but "
 		 "vstride is not width * hstride\n");
     }
Signature · 6 lines
1.8.5.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH 3/3 tests/gem_seqno_wrap: fix over allocation of buffers

In reply to Thomas Wood
---
 tests/gem_seqno_wrap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tests/gem_seqno_wrap.c +3 -3
index 40c6227..e37365f 100644
@@ -207,13 +207,13 @@ static int run_sync_test(int num_buffers, bool verify)
 	batch_3d = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd));
 	igt_assert(batch_3d);
 
-	src = malloc(num_buffers * sizeof(**src));
+	src = malloc(num_buffers * sizeof(*src));
 	igt_assert(src);
 
-	dst1 = malloc(num_buffers * sizeof(**dst1));
+	dst1 = malloc(num_buffers * sizeof(*dst1));
 	igt_assert(dst1);
 
-	dst2 = malloc(num_buffers * sizeof(**dst2));
+	dst2 = malloc(num_buffers * sizeof(*dst2));
 	igt_assert(dst2);
 
 	s_src = malloc(num_buffers * sizeof(*s_src));
Signature · 1 line
1.8.5.3
#4 lore raw

Re: [PATCH i-g-t 3/3] tests/gem_seqno_wrap: fix over allocation of buffers

Quoted 1 line

[PATCH i-g-t 3/3] tests/gem_seqno_wrap: fix over allocation of buffers

For clarity, this should probably be "fix over allocation of arrays", since the arrays were being allocated as an array of buffers instead of an array of pointers to buffers.

Regards,

Thomas

#5 lore raw

Re: [PATCH i-g-t 3/3] tests/gem_seqno_wrap: fix over allocation of buffers

Quoted 5 lines · Thomas Wood
Quoted 1 line

[PATCH i-g-t 3/3] tests/gem_seqno_wrap: fix over allocation of buffers

For clarity, this should probably be "fix over allocation of arrays", since the arrays were being allocated as an array of buffers instead of an array of pointers to buffers.

All patches merged, thanks. btw I've also switched to calloc - it's good security style to use an explicit array allocation function since those handle overflows already. But not worth the bother of another patch for testcases ;-)
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch