From patchwork Thu Jun 23 16:46:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Vlad X-Patchwork-Id: 9195589 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 825F16077D for ; Thu, 23 Jun 2016 16:42:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 736262843C for ; Thu, 23 Jun 2016 16:42:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 679502845C; Thu, 23 Jun 2016 16:42:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF05A2843C for ; Thu, 23 Jun 2016 16:42:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 70C3A6E982; Thu, 23 Jun 2016 16:42:41 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id BE7726E982 for ; Thu, 23 Jun 2016 16:42:39 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 23 Jun 2016 09:42:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.26,517,1459839600"; d="scan'208"; a="1008305132" Received: from mcvlad-wk.rb.intel.com ([10.237.105.57]) by fmsmga002.fm.intel.com with ESMTP; 23 Jun 2016 09:42:39 -0700 From: Marius Vlad To: intel-gfx@lists.freedesktop.org Date: Thu, 23 Jun 2016 19:46:02 +0300 Message-Id: <1466700363-22009-1-git-send-email-marius.c.vlad@intel.com> X-Mailer: git-send-email 2.8.1 Subject: [Intel-gfx] [PATCH i-g-t 1/2] tests/{kms_cursor_legacy, drv_missed_irq}, lib/drmtest: Fix warnings about unused function return values. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Marius Vlad CC: Chris Wilson --- lib/drmtest.c | 8 +++----- tests/drv_missed_irq.c | 2 +- tests/kms_cursor_legacy.c | 8 ++++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/drmtest.c b/lib/drmtest.c index 9a1232f..1e28f60 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -218,11 +218,11 @@ int drm_get_card(void) return -1; } -static void modprobe(const char *driver) +static int modprobe(const char *driver) { char buf[128]; snprintf(buf, sizeof(buf), "/sbin/modprobe -s %s", driver); - system(buf); + return system(buf); } /** @@ -236,8 +236,6 @@ static void modprobe(const char *driver) */ int __drm_open_driver(int chipset) { - if (chipset & DRIVER_VGEM) - modprobe("vgem"); for (int i = 0; i < 16; i++) { char name[80]; @@ -258,7 +256,7 @@ int __drm_open_driver(int chipset) if (chipset & DRIVER_VGEM && is_vgem_device(fd)) - return fd; + return (modprobe("vgem") == -1) ? -1 : fd; close(fd); } diff --git a/tests/drv_missed_irq.c b/tests/drv_missed_irq.c index 66d20ed..130a6aa 100644 --- a/tests/drv_missed_irq.c +++ b/tests/drv_missed_irq.c @@ -130,7 +130,7 @@ igt_simple_main fclose(file); file = igt_debugfs_fopen("i915_ring_test_irq", "r"); - fscanf(file, "%x", &expect_rings); + igt_assert_eq(fscanf(file, "%x", &expect_rings), 1); fclose(file); igt_debug("Testing rings %x\n", expect_rings); diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c index 00890c9..2228e99 100644 --- a/tests/kms_cursor_legacy.c +++ b/tests/kms_cursor_legacy.c @@ -238,6 +238,7 @@ static void flip(struct data *data, } igt_fork(child, 1) { unsigned long count = 0; + ssize_t nread; unsigned crtc = data->resources->crtcs[flip_pipe]; igt_until_timeout(timeout) { @@ -245,7 +246,8 @@ static void flip(struct data *data, drmModePageFlip(data->fd, crtc, fb_id, DRM_MODE_PAGE_FLIP_EVENT, NULL); - read(data->fd, buf, sizeof(buf)); + nread = read(data->fd, buf, sizeof(buf)); + igt_assert_eq(nread, sizeof(buf)); count++; } @@ -286,6 +288,7 @@ static void basic_flip(struct data *data) struct igt_fb fb_info; unsigned vblank_start; int target; + ssize_t nread; struct drm_event buf; uint32_t fb_id; @@ -338,7 +341,8 @@ static void basic_flip(struct data *data) igt_assert_eq(get_vblank(data->fd, 0, 0), vblank_start); igt_set_timeout(1, "Stuck page flip"); - read(data->fd, &buf, sizeof(buf)); + nread = read(data->fd, &buf, sizeof(buf)); + igt_assert_eq(nread, sizeof(buf)); igt_assert_eq(get_vblank(data->fd, 0, 0), vblank_start + 1); igt_reset_timeout();