summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-04-24 12:51:34 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-04-24 12:53:01 -0400
commit3d71a10891c31de9c667f15f8f37371a5664f759 (patch)
treecc2ff822e9ffa1636ad284d6b3beb8c74146cac6 /src
parenta01b2434054db1f7de9087634227c52abb48e291 (diff)
ecore-drm: add safety checks to all EAPI functions
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_drm/ecore_drm_device.c11
-rw-r--r--src/lib/ecore_drm/ecore_drm_evdev.c3
-rw-r--r--src/lib/ecore_drm/ecore_drm_fb.c4
-rw-r--r--src/lib/ecore_drm/ecore_drm_inputs.c1
-rw-r--r--src/lib/ecore_drm/ecore_drm_launcher.c2
-rw-r--r--src/lib/ecore_drm/ecore_drm_output.c18
-rw-r--r--src/lib/ecore_drm/ecore_drm_sprites.c8
-rw-r--r--src/lib/ecore_drm/ecore_drm_tty.c10
8 files changed, 38 insertions, 19 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_device.c b/src/lib/ecore_drm/ecore_drm_device.c
index f0908e2714..9919486cc6 100644
--- a/src/lib/ecore_drm/ecore_drm_device.c
+++ b/src/lib/ecore_drm/ecore_drm_device.c
@@ -334,7 +334,7 @@ EAPI Eina_Bool
334ecore_drm_device_close(Ecore_Drm_Device *dev) 334ecore_drm_device_close(Ecore_Drm_Device *dev)
335{ 335{
336 /* check for valid device */ 336 /* check for valid device */
337 if (!dev) return EINA_FALSE; 337 EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE);
338 338
339 /* delete udev watch */ 339 /* delete udev watch */
340 if (dev->watch) eeze_udev_watch_del(dev->watch); 340 if (dev->watch) eeze_udev_watch_del(dev->watch);
@@ -404,7 +404,7 @@ ecore_drm_device_master_drop(Ecore_Drm_Device *dev)
404EAPI int 404EAPI int
405ecore_drm_device_fd_get(Ecore_Drm_Device *dev) 405ecore_drm_device_fd_get(Ecore_Drm_Device *dev)
406{ 406{
407 if (!dev) return -1; 407 EINA_SAFETY_ON_NULL_RETURN_VAL(dev, -1);
408 return dev->drm.fd; 408 return dev->drm.fd;
409} 409}
410 410
@@ -412,7 +412,7 @@ EAPI void
412ecore_drm_device_window_set(Ecore_Drm_Device *dev, unsigned int window) 412ecore_drm_device_window_set(Ecore_Drm_Device *dev, unsigned int window)
413{ 413{
414 /* check for valid device */ 414 /* check for valid device */
415 if ((!dev) || (dev->drm.fd < 0)) return; 415 EINA_SAFETY_ON_TRUE_RETURN((!dev) || (dev->drm.fd < 0));
416 416
417 dev->window = window; 417 dev->window = window;
418} 418}
@@ -421,7 +421,7 @@ EAPI const char *
421ecore_drm_device_name_get(Ecore_Drm_Device *dev) 421ecore_drm_device_name_get(Ecore_Drm_Device *dev)
422{ 422{
423 /* check for valid device */ 423 /* check for valid device */
424 if ((!dev) || (dev->drm.fd < 0)) return NULL; 424 EINA_SAFETY_ON_TRUE_RETURN_VAL((!dev) || (dev->drm.fd < 0), NULL);
425 425
426 return dev->drm.name; 426 return dev->drm.name;
427} 427}
@@ -437,7 +437,7 @@ ecore_drm_device_pointer_xy_get(Ecore_Drm_Device *dev, int *x, int *y)
437 if (y) *y = 0; 437 if (y) *y = 0;
438 438
439 /* check for valid device */ 439 /* check for valid device */
440 if ((!dev) || (dev->drm.fd < 0)) return; 440 EINA_SAFETY_ON_TRUE_RETURN((!dev) || (dev->drm.fd < 0));
441 441
442 EINA_LIST_FOREACH(dev->seats, l, seat) 442 EINA_LIST_FOREACH(dev->seats, l, seat)
443 { 443 {
@@ -508,6 +508,7 @@ ecore_drm_device_output_find(Ecore_Drm_Device *dev, int x, int y)
508 Eina_List *l; 508 Eina_List *l;
509 509
510 EINA_SAFETY_ON_NULL_RETURN_VAL(dev, NULL); 510 EINA_SAFETY_ON_NULL_RETURN_VAL(dev, NULL);
511 EINA_SAFETY_ON_TRUE_RETURN_VAL((x < 0) || (y < 0), NULL);
511 512
512 EINA_LIST_FOREACH(dev->outputs, l, output) 513 EINA_LIST_FOREACH(dev->outputs, l, output)
513 { 514 {
diff --git a/src/lib/ecore_drm/ecore_drm_evdev.c b/src/lib/ecore_drm/ecore_drm_evdev.c
index 04275fdb70..f56e372453 100644
--- a/src/lib/ecore_drm/ecore_drm_evdev.c
+++ b/src/lib/ecore_drm/ecore_drm_evdev.c
@@ -879,7 +879,8 @@ ecore_drm_inputs_device_axis_size_set(Ecore_Drm_Evdev *edev, int w, int h)
879 const char *vals; 879 const char *vals;
880 enum libinput_config_status status; 880 enum libinput_config_status status;
881 881
882 if ((w == 0) || (h == 0)) return; 882 EINA_SAFETY_ON_NULL_RETURN(edev);
883 EINA_SAFETY_ON_TRUE_RETURN((w == 0) || (h == 0));
883 884
884 if ((!libinput_device_config_calibration_has_matrix(edev->device)) || 885 if ((!libinput_device_config_calibration_has_matrix(edev->device)) ||
885 (libinput_device_config_calibration_get_default_matrix(edev->device, cal) != 0)) 886 (libinput_device_config_calibration_get_default_matrix(edev->device, cal) != 0))
diff --git a/src/lib/ecore_drm/ecore_drm_fb.c b/src/lib/ecore_drm/ecore_drm_fb.c
index a3e3b37f85..982f962f7c 100644
--- a/src/lib/ecore_drm/ecore_drm_fb.c
+++ b/src/lib/ecore_drm/ecore_drm_fb.c
@@ -55,6 +55,8 @@ ecore_drm_fb_create(Ecore_Drm_Device *dev, int width, int height)
55 struct drm_mode_destroy_dumb darg; 55 struct drm_mode_destroy_dumb darg;
56 struct drm_mode_map_dumb marg; 56 struct drm_mode_map_dumb marg;
57 57
58 EINA_SAFETY_ON_NULL_RETURN_VAL(dev, NULL);
59 EINA_SAFETY_ON_TRUE_RETURN_VAL((width < 1) || (height < 1), NULL);
58 if (!(fb = calloc(1, sizeof(Ecore_Drm_Fb)))) return NULL; 60 if (!(fb = calloc(1, sizeof(Ecore_Drm_Fb)))) return NULL;
59 61
60 memset(&carg, 0, sizeof(struct drm_mode_create_dumb)); 62 memset(&carg, 0, sizeof(struct drm_mode_create_dumb));
@@ -139,6 +141,8 @@ EAPI void
139ecore_drm_fb_dirty(Ecore_Drm_Fb *fb, Eina_Rectangle *rects, unsigned int count) 141ecore_drm_fb_dirty(Ecore_Drm_Fb *fb, Eina_Rectangle *rects, unsigned int count)
140{ 142{
141 EINA_SAFETY_ON_NULL_RETURN(fb); 143 EINA_SAFETY_ON_NULL_RETURN(fb);
144 EINA_SAFETY_ON_NULL_RETURN(rects);
145 EINA_SAFETY_ON_TRUE_RETURN(!count);
142 146
143#ifdef DRM_MODE_FEATURE_DIRTYFB 147#ifdef DRM_MODE_FEATURE_DIRTYFB
144 drmModeClip *clip; 148 drmModeClip *clip;
diff --git a/src/lib/ecore_drm/ecore_drm_inputs.c b/src/lib/ecore_drm/ecore_drm_inputs.c
index bfd237cc2b..1b517b616f 100644
--- a/src/lib/ecore_drm/ecore_drm_inputs.c
+++ b/src/lib/ecore_drm/ecore_drm_inputs.c
@@ -292,6 +292,7 @@ ecore_drm_inputs_destroy(Ecore_Drm_Device *dev)
292 Ecore_Drm_Seat *seat; 292 Ecore_Drm_Seat *seat;
293 Ecore_Drm_Evdev *edev; 293 Ecore_Drm_Evdev *edev;
294 294
295 EINA_SAFETY_ON_NULL_RETURN(dev);
295 EINA_LIST_FREE(dev->seats, seat) 296 EINA_LIST_FREE(dev->seats, seat)
296 { 297 {
297 EINA_LIST_FREE(seat->devices, edev) 298 EINA_LIST_FREE(seat->devices, edev)
diff --git a/src/lib/ecore_drm/ecore_drm_launcher.c b/src/lib/ecore_drm/ecore_drm_launcher.c
index 8166fe4804..e66918a6f0 100644
--- a/src/lib/ecore_drm/ecore_drm_launcher.c
+++ b/src/lib/ecore_drm/ecore_drm_launcher.c
@@ -56,6 +56,7 @@ _ecore_drm_launcher_device_flags_set(int fd, int flags)
56EAPI Eina_Bool 56EAPI Eina_Bool
57ecore_drm_launcher_connect(Ecore_Drm_Device *dev) 57ecore_drm_launcher_connect(Ecore_Drm_Device *dev)
58{ 58{
59 EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE);
59 /* try to connect to logind */ 60 /* try to connect to logind */
60 if (!(logind = _ecore_drm_logind_connect(dev))) 61 if (!(logind = _ecore_drm_logind_connect(dev)))
61 { 62 {
@@ -86,6 +87,7 @@ ecore_drm_launcher_connect(Ecore_Drm_Device *dev)
86EAPI void 87EAPI void
87ecore_drm_launcher_disconnect(Ecore_Drm_Device *dev) 88ecore_drm_launcher_disconnect(Ecore_Drm_Device *dev)
88{ 89{
90 EINA_SAFETY_ON_NULL_RETURN(dev);
89 if (dev->tty.switch_hdlr) ecore_event_handler_del(dev->tty.switch_hdlr); 91 if (dev->tty.switch_hdlr) ecore_event_handler_del(dev->tty.switch_hdlr);
90 dev->tty.switch_hdlr = NULL; 92 dev->tty.switch_hdlr = NULL;
91 93
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index dbcd088caf..b564f10626 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -721,6 +721,7 @@ ecore_drm_outputs_create(Ecore_Drm_Device *dev)
721 int i = 0, x = 0, y = 0; 721 int i = 0, x = 0, y = 0;
722 722
723 EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE); 723 EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE);
724 EINA_SAFETY_ON_TRUE_RETURN_VAL(dev->drm.fd < 0, EINA_FALSE);
724 725
725 /* DBG("Create outputs for %d", dev->drm.fd); */ 726 /* DBG("Create outputs for %d", dev->drm.fd); */
726 727
@@ -788,7 +789,7 @@ ecore_drm_output_free(Ecore_Drm_Output *output)
788EAPI void 789EAPI void
789ecore_drm_output_cursor_size_set(Ecore_Drm_Output *output, int handle, int w, int h) 790ecore_drm_output_cursor_size_set(Ecore_Drm_Output *output, int handle, int w, int h)
790{ 791{
791 if (!output) return; 792 EINA_SAFETY_ON_NULL_RETURN(output);
792 drmModeSetCursor(output->dev->drm.fd, output->crtc_id, handle, w, h); 793 drmModeSetCursor(output->dev->drm.fd, output->crtc_id, handle, w, h);
793} 794}
794 795
@@ -800,9 +801,10 @@ ecore_drm_output_enable(Ecore_Drm_Output *output)
800 int x = 0, y = 0; 801 int x = 0, y = 0;
801 802
802 EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); 803 EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
804 EINA_SAFETY_ON_NULL_RETURN_VAL(output->dev, EINA_FALSE);
803 EINA_SAFETY_ON_NULL_RETURN_VAL(output->current_mode, EINA_FALSE); 805 EINA_SAFETY_ON_NULL_RETURN_VAL(output->current_mode, EINA_FALSE);
804 806
805 if (!(dev = output->dev)) return EINA_FALSE; 807 dev = output->dev;
806 808
807 output->enabled = EINA_TRUE; 809 output->enabled = EINA_TRUE;
808 if (!dev->current) 810 if (!dev->current)
@@ -847,6 +849,8 @@ ecore_drm_output_disable(Ecore_Drm_Output *output)
847EAPI void 849EAPI void
848ecore_drm_output_fb_release(Ecore_Drm_Output *output, Ecore_Drm_Fb *fb) 850ecore_drm_output_fb_release(Ecore_Drm_Output *output, Ecore_Drm_Fb *fb)
849{ 851{
852 EINA_SAFETY_ON_NULL_RETURN(output);
853 EINA_SAFETY_ON_NULL_RETURN(fb);
850 _ecore_drm_output_fb_release(output, fb); 854 _ecore_drm_output_fb_release(output, fb);
851} 855}
852 856
@@ -859,9 +863,10 @@ ecore_drm_output_repaint(Ecore_Drm_Output *output)
859 int ret = 0; 863 int ret = 0;
860 864
861 EINA_SAFETY_ON_NULL_RETURN(output); 865 EINA_SAFETY_ON_NULL_RETURN(output);
866 EINA_SAFETY_ON_NULL_RETURN(output->dev);
862 EINA_SAFETY_ON_TRUE_RETURN(output->pending_destroy); 867 EINA_SAFETY_ON_TRUE_RETURN(output->pending_destroy);
863 868
864 if (!(dev = output->dev)) return; 869 dev = output->dev;
865 870
866 /* DBG("Output Repaint: %d %d", output->crtc_id, output->conn_id); */ 871 /* DBG("Output Repaint: %d %d", output->crtc_id, output->conn_id); */
867 872
@@ -942,7 +947,7 @@ ecore_drm_output_size_get(Ecore_Drm_Device *dev, int output, int *w, int *h)
942 947
943 if (w) *w = 0; 948 if (w) *w = 0;
944 if (h) *h = 0; 949 if (h) *h = 0;
945 if (!dev) return; 950 EINA_SAFETY_ON_NULL_RETURN(dev);
946 951
947 if (!(fb = drmModeGetFB(dev->drm.fd, output))) return; 952 if (!(fb = drmModeGetFB(dev->drm.fd, output))) return;
948 if (w) *w = fb->width; 953 if (w) *w = fb->width;
@@ -961,7 +966,7 @@ ecore_drm_outputs_geometry_get(Ecore_Drm_Device *dev, int *x, int *y, int *w, in
961 if (y) *y = 0; 966 if (y) *y = 0;
962 if (w) *w = 0; 967 if (w) *w = 0;
963 if (h) *h = 0; 968 if (h) *h = 0;
964 if (!dev) return; 969 EINA_SAFETY_ON_NULL_RETURN(dev);
965 970
966 EINA_LIST_FOREACH(dev->outputs, l, output) 971 EINA_LIST_FOREACH(dev->outputs, l, output)
967 { 972 {
@@ -1032,6 +1037,7 @@ EAPI void
1032ecore_drm_output_dpms_set(Ecore_Drm_Output *output, int level) 1037ecore_drm_output_dpms_set(Ecore_Drm_Output *output, int level)
1033{ 1038{
1034 EINA_SAFETY_ON_NULL_RETURN(output); 1039 EINA_SAFETY_ON_NULL_RETURN(output);
1040 EINA_SAFETY_ON_NULL_RETURN(output->dev);
1035 EINA_SAFETY_ON_NULL_RETURN(output->dpms); 1041 EINA_SAFETY_ON_NULL_RETURN(output->dpms);
1036 1042
1037 drmModeConnectorSetProperty(output->dev->drm.fd, output->conn_id, 1043 drmModeConnectorSetProperty(output->dev->drm.fd, output->conn_id,
@@ -1042,6 +1048,7 @@ EAPI void
1042ecore_drm_output_gamma_set(Ecore_Drm_Output *output, uint16_t size, uint16_t *r, uint16_t *g, uint16_t *b) 1048ecore_drm_output_gamma_set(Ecore_Drm_Output *output, uint16_t size, uint16_t *r, uint16_t *g, uint16_t *b)
1043{ 1049{
1044 EINA_SAFETY_ON_NULL_RETURN(output); 1050 EINA_SAFETY_ON_NULL_RETURN(output);
1051 EINA_SAFETY_ON_NULL_RETURN(output->dev);
1045 EINA_SAFETY_ON_NULL_RETURN(output->crtc); 1052 EINA_SAFETY_ON_NULL_RETURN(output->crtc);
1046 1053
1047 if (output->gamma != size) return; 1054 if (output->gamma != size) return;
@@ -1065,6 +1072,7 @@ ecore_drm_output_crtc_buffer_get(Ecore_Drm_Output *output)
1065 unsigned int id = 0; 1072 unsigned int id = 0;
1066 1073
1067 EINA_SAFETY_ON_NULL_RETURN_VAL(output, 0); 1074 EINA_SAFETY_ON_NULL_RETURN_VAL(output, 0);
1075 EINA_SAFETY_ON_NULL_RETURN_VAL(output->dev, 0);
1068 EINA_SAFETY_ON_NULL_RETURN_VAL(output->crtc, 0); 1076 EINA_SAFETY_ON_NULL_RETURN_VAL(output->crtc, 0);
1069 1077
1070 if (!(crtc = drmModeGetCrtc(output->dev->drm.fd, output->crtc_id))) 1078 if (!(crtc = drmModeGetCrtc(output->dev->drm.fd, output->crtc_id)))
diff --git a/src/lib/ecore_drm/ecore_drm_sprites.c b/src/lib/ecore_drm/ecore_drm_sprites.c
index ee9d909024..d3fa71dcde 100644
--- a/src/lib/ecore_drm/ecore_drm_sprites.c
+++ b/src/lib/ecore_drm/ecore_drm_sprites.c
@@ -21,7 +21,7 @@ ecore_drm_sprites_create(Ecore_Drm_Device *dev)
21 unsigned int i = 0; 21 unsigned int i = 0;
22 22
23 /* check for valid device */ 23 /* check for valid device */
24 if ((!dev) || (dev->drm.fd < 0)) return EINA_FALSE; 24 EINA_SAFETY_ON_TRUE_RETURN_VAL((!dev) || (dev->drm.fd < 0), EINA_FALSE);
25 25
26 /* get plane resources */ 26 /* get plane resources */
27 if (!(res = drmModeGetPlaneResources(dev->drm.fd))) return EINA_FALSE; 27 if (!(res = drmModeGetPlaneResources(dev->drm.fd))) return EINA_FALSE;
@@ -66,7 +66,7 @@ ecore_drm_sprites_destroy(Ecore_Drm_Device *dev)
66 Ecore_Drm_Sprite *sprite; 66 Ecore_Drm_Sprite *sprite;
67 67
68 /* check for valid device */ 68 /* check for valid device */
69 if (!dev) return; 69 EINA_SAFETY_ON_NULL_RETURN(dev);
70 70
71 EINA_LIST_FREE(dev->sprites, sprite) 71 EINA_LIST_FREE(dev->sprites, sprite)
72 { 72 {
@@ -82,7 +82,7 @@ ecore_drm_sprites_destroy(Ecore_Drm_Device *dev)
82EAPI void 82EAPI void
83ecore_drm_sprites_fb_set(Ecore_Drm_Sprite *sprite, int fb_id, int flags) 83ecore_drm_sprites_fb_set(Ecore_Drm_Sprite *sprite, int fb_id, int flags)
84{ 84{
85 if ((!sprite) || (!sprite->output)) return; 85 EINA_SAFETY_ON_TRUE_RETURN((!sprite) || (!sprite->output));
86 86
87 if (fb_id) 87 if (fb_id)
88 { 88 {
@@ -106,6 +106,8 @@ ecore_drm_sprites_crtc_supported(Ecore_Drm_Output *output, unsigned int supporte
106 Ecore_Drm_Device *dev; 106 Ecore_Drm_Device *dev;
107 unsigned int c = 0; 107 unsigned int c = 0;
108 108
109 EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
110 EINA_SAFETY_ON_NULL_RETURN_VAL(output->dev, EINA_FALSE);
109 dev = output->dev; 111 dev = output->dev;
110 112
111 for (c = 0; c < dev->crtc_count; c++) 113 for (c = 0; c < dev->crtc_count; c++)
diff --git a/src/lib/ecore_drm/ecore_drm_tty.c b/src/lib/ecore_drm/ecore_drm_tty.c
index e7f394d2fb..b21773d019 100644
--- a/src/lib/ecore_drm/ecore_drm_tty.c
+++ b/src/lib/ecore_drm/ecore_drm_tty.c
@@ -135,7 +135,7 @@ ecore_drm_tty_open(Ecore_Drm_Device *dev, const char *name)
135 char tty[32] = "<stdin>"; 135 char tty[32] = "<stdin>";
136 136
137 /* check for valid device */ 137 /* check for valid device */
138 if ((!dev) || (!dev->drm.name)) return EINA_FALSE; 138 EINA_SAFETY_ON_TRUE_RETURN_VAL((!dev) || (!dev->drm.name), EINA_FALSE);
139 139
140 /* assign default tty fd of -1 */ 140 /* assign default tty fd of -1 */
141 dev->tty.fd = -1; 141 dev->tty.fd = -1;
@@ -226,7 +226,7 @@ EAPI Eina_Bool
226ecore_drm_tty_close(Ecore_Drm_Device *dev) 226ecore_drm_tty_close(Ecore_Drm_Device *dev)
227{ 227{
228 /* check for valid device */ 228 /* check for valid device */
229 if ((!dev) || (!dev->drm.name)) return EINA_FALSE; 229 EINA_SAFETY_ON_TRUE_RETURN_VAL((!dev) || (!dev->drm.name), EINA_FALSE);
230 230
231 _ecore_drm_tty_restore(dev); 231 _ecore_drm_tty_restore(dev);
232 232
@@ -247,7 +247,7 @@ EAPI Eina_Bool
247ecore_drm_tty_release(Ecore_Drm_Device *dev) 247ecore_drm_tty_release(Ecore_Drm_Device *dev)
248{ 248{
249 /* check for valid device */ 249 /* check for valid device */
250 if ((!dev) || (!dev->drm.name) || (dev->tty.fd < 0)) return EINA_FALSE; 250 EINA_SAFETY_ON_TRUE_RETURN_VAL((!dev) || (!dev->drm.name) || (dev->tty.fd < 0), EINA_FALSE);
251 251
252 /* send ioctl for vt release */ 252 /* send ioctl for vt release */
253 if (ioctl(dev->tty.fd, VT_RELDISP, 1) < 0) 253 if (ioctl(dev->tty.fd, VT_RELDISP, 1) < 0)
@@ -263,7 +263,7 @@ EAPI Eina_Bool
263ecore_drm_tty_acquire(Ecore_Drm_Device *dev) 263ecore_drm_tty_acquire(Ecore_Drm_Device *dev)
264{ 264{
265 /* check for valid device */ 265 /* check for valid device */
266 if ((!dev) || (!dev->drm.name) || (dev->tty.fd < 0)) return EINA_FALSE; 266 EINA_SAFETY_ON_TRUE_RETURN_VAL((!dev) || (!dev->drm.name) || (dev->tty.fd < 0), EINA_FALSE);
267 267
268 /* send ioctl for vt acquire */ 268 /* send ioctl for vt acquire */
269 if (ioctl(dev->tty.fd, VT_RELDISP, VT_ACKACQ) < 0) 269 if (ioctl(dev->tty.fd, VT_RELDISP, VT_ACKACQ) < 0)
@@ -279,7 +279,7 @@ EAPI int
279ecore_drm_tty_get(Ecore_Drm_Device *dev) 279ecore_drm_tty_get(Ecore_Drm_Device *dev)
280{ 280{
281 /* check for valid device */ 281 /* check for valid device */
282 if ((!dev) || (!dev->drm.name) || (dev->tty.fd < 0)) return -1; 282 EINA_SAFETY_ON_TRUE_RETURN_VAL((!dev) || (!dev->drm.name) || (dev->tty.fd < 0), -1);
283 283
284 return dev->tty.fd; 284 return dev->tty.fd;
285} 285}