mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-17 11:22:56 +00:00
lib: remove unnecessary checks on the drm_open_any return value
drm_open_any always returns a valid file descriptor, so there is no need to check the return value. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
This commit is contained in:
+3
-3
@@ -302,10 +302,10 @@ static void quiescent_gpu_at_exit_render(int sig)
|
||||
/**
|
||||
* drm_open_any:
|
||||
*
|
||||
* Open an i915 drm legacy device node.
|
||||
* Open an i915 drm legacy device node. This function always returns a valid
|
||||
* file descriptor.
|
||||
*
|
||||
* Returns:
|
||||
* The i915 drm file descriptor or -1 on error
|
||||
* Returns: a i915 drm file descriptor
|
||||
*/
|
||||
int drm_open_any(void)
|
||||
{
|
||||
|
||||
@@ -127,3 +127,17 @@ expression b;
|
||||
- ((a) >= (b) ? (a) : (b))
|
||||
+ max(a, b)
|
||||
)
|
||||
|
||||
// drm_open_any always returns a valid file descriptor
|
||||
@@
|
||||
expression a;
|
||||
@@
|
||||
a = drm_open_any();
|
||||
(
|
||||
- igt_assert(a >= 0);
|
||||
|
|
||||
- if (a < 0) {
|
||||
- ...
|
||||
- return ...;
|
||||
- }
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user