From patchwork Wed Oct 10 13:04:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 1573631 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 3EE0BDFB34 for ; Wed, 10 Oct 2012 13:09:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 179C89E7B8 for ; Wed, 10 Oct 2012 06:09:04 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id EC2BB9E760 for ; Wed, 10 Oct 2012 06:05:01 -0700 (PDT) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 10 Oct 2012 06:05:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,564,1344236400"; d="scan'208";a="202780304" Received: from ideak-desk.fi.intel.com (HELO localhost) ([10.237.72.98]) by azsmga001.ch.intel.com with ESMTP; 10 Oct 2012 06:05:00 -0700 From: Imre Deak To: intel-gfx@lists.freedesktop.org Date: Wed, 10 Oct 2012 16:04:44 +0300 Message-Id: <1349874285-31536-8-git-send-email-imre.deak@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1349874285-31536-1-git-send-email-imre.deak@intel.com> References: <1349874285-31536-1-git-send-email-imre.deak@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] =?utf-8?q?=5BPATCH_7/8=5D_fix_warn_in_prime=5Fnv=5F*?= =?utf-8?q?=3A_ignoring_return_value_of_=E2=80=98fgets=E2=80=99?= X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Signed-off-by: Imre Deak --- tests/prime_nv_api.c | 5 ++++- tests/prime_nv_test.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/prime_nv_api.c b/tests/prime_nv_api.c index 962e903..e1b7117 100644 --- a/tests/prime_nv_api.c +++ b/tests/prime_nv_api.c @@ -38,6 +38,8 @@ static int find_and_open_devices(void) char vendor_id[8]; int venid; for (i = 0; i < 9; i++) { + char *ret; + sprintf(path, "/sys/class/drm/card%d/device/vendor", i); if (stat(path, &buf)) break; @@ -46,7 +48,8 @@ static int find_and_open_devices(void) if (!fl) break; - fgets(vendor_id, 8, fl); + ret = fgets(vendor_id, 8, fl); + assert(ret); fclose(fl); venid = strtoul(vendor_id, NULL, 16); diff --git a/tests/prime_nv_test.c b/tests/prime_nv_test.c index 2269f84..f9a766a 100644 --- a/tests/prime_nv_test.c +++ b/tests/prime_nv_test.c @@ -46,6 +46,8 @@ static int find_and_open_devices(void) char vendor_id[8]; int venid; for (i = 0; i < 9; i++) { + char *ret; + sprintf(path, "/sys/class/drm/card%d/device/vendor", i); if (stat(path, &buf)) break; @@ -54,7 +56,8 @@ static int find_and_open_devices(void) if (!fl) break; - fgets(vendor_id, 8, fl); + ret = fgets(vendor_id, 8, fl); + assert(ret); fclose(fl); venid = strtoul(vendor_id, NULL, 16);