From patchwork Wed Apr 8 09:56:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 6178041 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F24929F2E9 for ; Wed, 8 Apr 2015 09:56:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0FF4520357 for ; Wed, 8 Apr 2015 09:56:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2470D20263 for ; Wed, 8 Apr 2015 09:56:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 95C966E67D; Wed, 8 Apr 2015 02:56:57 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by gabe.freedesktop.org (Postfix) with ESMTP id C8E9C6E67D for ; Wed, 8 Apr 2015 02:56:55 -0700 (PDT) Received: by wgbdm7 with SMTP id dm7so82585716wgb.1 for ; Wed, 08 Apr 2015 02:56:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=BQCPUJ+xg3S65nj2ZmKl3+1b4j1x07DsbRD8JNnBQ8g=; b=e5fO256Gn7mX06Q22qGV38GxIgQ8oUPcVBHEqNZCp3uslBIik5Es5OPdVb0OCl7Bws VGorQZbssNlle0M+cpjN0QGrb7qIq6ERBcbFI9Ukuvo6vTCy+v+kgC759zm9sSys+SzF GQbrWUj1Pbbjwp0lm0IXlwBBoqG6a1xC3KKy49yD7AYcMTMLYl/98UDgcAIs85Ppvtx3 IX3+Biz+nrDxOB9RJfGJ1PtlHdckxIYZi9niTUZrUKQbitVX/S6HUPR9diq7v6zNvW+m Ws5xZbj73oE3aHqRcuhb++VQUpk21ZiT/0+FsJRVkwczYsDAV9jtbAP++rAZVQzt2TcE AR4w== X-Gm-Message-State: ALoCoQneMMMakzuvhUPm4ur/2UURH7owK3zQAr1IZZsl6Sz+2LxcmAJY5cTZdZw/yAjUS3yxYlg7 X-Received: by 10.194.142.205 with SMTP id ry13mr49794067wjb.73.1428487014648; Wed, 08 Apr 2015 02:56:54 -0700 (PDT) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id a6sm14891182wiy.17.2015.04.08.02.56.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Apr 2015 02:56:53 -0700 (PDT) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Wed, 8 Apr 2015 10:56:52 +0100 Message-Id: <1428487012-19221-1-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 2.1.0 Subject: [Intel-gfx] [PATCH i-g-t] tests/kms_fbc_crc: fix fread() return value assertion 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use 1 as the element size to check the number of bytes returned is greater than 0, rather than checking the number of elements returned. This fixes a regression from commit 47f6b13 (igt.cocci: check the return values of various functions). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89833 Signed-off-by: Thomas Wood --- tests/kms_fbc_crc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c index 10e1ca4..ccdec33 100644 --- a/tests/kms_fbc_crc.c +++ b/tests/kms_fbc_crc.c @@ -510,7 +510,7 @@ igt_main status = igt_debugfs_fopen("i915_fbc_status", "r"); igt_require_f(status, "No i915_fbc_status found\n"); - igt_assert_eq(fread(buf, sizeof(buf), 1, status), sizeof(buf)); + igt_assert_lt(0, fread(buf, 1, sizeof(buf), status)); fclose(status); buf[sizeof(buf) - 1] = '\0'; igt_require_f(!strstr(buf, "unsupported by this chipset") &&