summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunkyeong Kim <jk0430.kim@samsung.com>2017-09-26 19:46:36 +0900
committerJunkyeong Kim <jk0430.kim@samsung.com>2017-09-26 19:48:00 +0900
commit28cd5da25ce9e52a618a82183c2d5cb70298749f (patch)
tree680f2f976a3b444e6295ecd4af4b7d7dafc56b78
parentcf183eb726b0b89bc1d5d8e97e2feb93e1c2c3ab (diff)
downloadlibtbm-dumb-28cd5da25ce9e52a618a82183c2d5cb70298749f.tar.gz
libtbm-dumb-28cd5da25ce9e52a618a82183c2d5cb70298749f.tar.bz2
libtbm-dumb-28cd5da25ce9e52a618a82183c2d5cb70298749f.zip
declare variables at the beginning of the function
Change-Id: I1341cb3887d40b743efb3b0164fb29a96a082579 Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
-rw-r--r--src/tbm_bufmgr_dumb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tbm_bufmgr_dumb.c b/src/tbm_bufmgr_dumb.c
index 2a5b375..01705b1 100644
--- a/src/tbm_bufmgr_dumb.c
+++ b/src/tbm_bufmgr_dumb.c
@@ -1366,6 +1366,9 @@ init_tbm_bufmgr_priv(tbm_bufmgr bufmgr, int fd)
tbm_bufmgr_backend bufmgr_backend;
uint64_t cap = 0;
uint32_t ret;
+ int fp;
+ int length;
+ char buf[1];
if (!bufmgr)
return 0;
@@ -1411,9 +1414,7 @@ init_tbm_bufmgr_priv(tbm_bufmgr bufmgr, int fd)
bufmgr_dumb->hashBos = drmHashCreate();
//Check if the tbm manager supports dma fence or not.
- int fp = open("/sys/module/dmabuf_sync/parameters/enabled", O_RDONLY);
- int length;
- char buf[1];
+ fp = open("/sys/module/dmabuf_sync/parameters/enabled", O_RDONLY);
if (fp != -1) {
length = read(fp, buf, 1);