Skip to contentSkip to conversation

drmOpenByName: remove redundant drmAvailable check

PATCH In review Daniel Kurtz 3 participants 5 messages Apr 17, 2014 – May 13, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drmOpenByName: remove redundant drmAvailable check

drmOpenByName() is a static function that is only called by drmOpen(). drmOpen() already checks drmAvailable(), so the checki in drmOpenByName() is redundant.

---
 xf86drm.c | 13 -------------
 1 file changed, 13 deletions(-)
xf86drm.c +0 -13
index 720952f..118022c 100644
@@ -537,19 +537,6 @@ static int drmOpenByName(const char *name)
     int           fd;
     drmVersionPtr version;
     char *        id;
-    
-    if (!drmAvailable()) {
-	if (!drm_server_info) {
-	    return -1;
-	}
-	else {
-	    /* try to load the kernel module now */
-	    if (!drm_server_info->load_module(name)) {
-		drmMsg("[drm] failed to load kernel module \"%s\"\n", name);
-		return -1;
-	    }
-	}
-    }
 
     /*
      * Open the first minor number that matches the driver name and isn't
Signature · 1 line
1.9.1.423.g4596e3a
#1 lore raw

Rob,
Can you take a look at this one too, now that I have your attention :-). -djk

Quoted 36 lines · Daniel Kurtz

drmOpenByName() is a static function that is only called by drmOpen(). drmOpen() already checks drmAvailable(), so the checki in drmOpenByName() is redundant.

---
 xf86drm.c | 13 -------------
 1 file changed, 13 deletions(-)
xf86drm.c +0 -14
index 720952f..118022c 100644
@@ -537,19 +537,6 @@ static int drmOpenByName(const char *name)
     int           fd;
     drmVersionPtr version;
     char *        id;
-
-    if (!drmAvailable()) {
-       if (!drm_server_info) {
-           return -1;
-       }
-       else {
-           /* try to load the kernel module now */
-           if (!drm_server_info->load_module(name)) {
-               drmMsg("[drm] failed to load kernel module \"%s\"\n", name);
-               return -1;
-           }
-       }
-    }
 
     /*
      * Open the first minor number that matches the driver name and isn't
--

1.9.1.423.g4596e3a

#3 lore raw
Quoted 6 lines · Thierry Reding
Quoted 2 lines · Daniel Kurtz

Rob,
Can you take a look at this one too, now that I have your attention :-).

Oh, and now I read that you wanted Rob to look at this. Rob, I hope you don't mind me jumping the queue.

thx Thierry, I'm not going to argue about someone doing my work for me before I have a chance to :-P

#4 lore raw
In reply to Daniel Kurtz
Quoted 8 lines · Daniel Kurtz

drmOpenByName() is a static function that is only called by drmOpen(). drmOpen() already checks drmAvailable(), so the checki in drmOpenByName() is redundant.

---
 xf86drm.c | 13 -------------
 1 file changed, 13 deletions(-)

Looks good to me. I've fixed up the typo (checki -> check) in the commit message and pushed this.

Thierry

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel