igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib: Fix strcmp() direction for bsearch.
@ 2018-09-03  9:46 Chris Wilson
  2018-09-03  9:51 ` Petri Latvala
  2018-09-03 10:23 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2018-09-03  9:46 UTC (permalink / raw)
  To: igt-dev

I fluked out as vgem was the initial mid value, hidding the worst of the
errors as i915 matched with DRIVER_ANY.

Fixes: 20087bf22698 ("lib: Use a bsearch to find the module name")
Reported-by: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala@intel.com>
---
 lib/drmtest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index bfb38f1e9..adff1a81f 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -226,9 +226,9 @@ static int open_device(const char *name, unsigned int chipset)
 		int mid = start + (end - start) / 2;
 		int ret = strcmp(modules[mid].module, dev_name);
 		if (ret < 0) {
-			end = mid;
-		} else if (ret > 0) {
 			start = mid + 1;
+		} else if (ret > 0) {
+			end = mid;
 		} else {
 			chip = modules[mid].bit;
 			break;
-- 
2.19.0.rc1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] lib: Fix strcmp() direction for bsearch.
  2018-09-03  9:46 [igt-dev] [PATCH i-g-t] lib: Fix strcmp() direction for bsearch Chris Wilson
@ 2018-09-03  9:51 ` Petri Latvala
  2018-09-03 10:23 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Petri Latvala @ 2018-09-03  9:51 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

On Mon, Sep 03, 2018 at 10:46:29AM +0100, Chris Wilson wrote:
> I fluked out as vgem was the initial mid value, hidding the worst of the
> errors as i915 matched with DRIVER_ANY.
> 
> Fixes: 20087bf22698 ("lib: Use a bsearch to find the module name")
> Reported-by: Petri Latvala <petri.latvala@intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Petri Latvala <petri.latvala@intel.com>


Reviewed-by: Petri Latvala <petri.latvala@intel.com>


One more lurking bug is that if there's a drm device that's not
recognized, its fd is silently just returned even if the test
requested DRIVER_SOMETHING_SPECIFIC.



> ---
>  lib/drmtest.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index bfb38f1e9..adff1a81f 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -226,9 +226,9 @@ static int open_device(const char *name, unsigned int chipset)
>  		int mid = start + (end - start) / 2;
>  		int ret = strcmp(modules[mid].module, dev_name);
>  		if (ret < 0) {
> -			end = mid;
> -		} else if (ret > 0) {
>  			start = mid + 1;
> +		} else if (ret > 0) {
> +			end = mid;
>  		} else {
>  			chip = modules[mid].bit;
>  			break;
> -- 
> 2.19.0.rc1
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [igt-dev] ✗ Fi.CI.BAT: failure for lib: Fix strcmp() direction for bsearch.
  2018-09-03  9:46 [igt-dev] [PATCH i-g-t] lib: Fix strcmp() direction for bsearch Chris Wilson
  2018-09-03  9:51 ` Petri Latvala
@ 2018-09-03 10:23 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2018-09-03 10:23 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: lib: Fix strcmp() direction for bsearch.
URL   : https://patchwork.freedesktop.org/series/49070/
State : failure

== Summary ==

Series 49070 revision 1 was fully merged or fully failed: no git log

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-03 10:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-03  9:46 [igt-dev] [PATCH i-g-t] lib: Fix strcmp() direction for bsearch Chris Wilson
2018-09-03  9:51 ` Petri Latvala
2018-09-03 10:23 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).