From patchwork Wed May 20 12:17:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Morton X-Patchwork-Id: 6445301 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 3E0929F1C1 for ; Wed, 20 May 2015 12:18:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DAAE20351 for ; Wed, 20 May 2015 12:18:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4D6DF202FF for ; Wed, 20 May 2015 12:18:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 610406E73A; Wed, 20 May 2015 05:18:00 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 978036E73A for ; Wed, 20 May 2015 05:17:59 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 20 May 2015 05:17:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,464,1427785200"; d="scan'208";a="728973351" Received: from djmorton-linux.isw.intel.com ([10.102.226.153]) by fmsmga002.fm.intel.com with ESMTP; 20 May 2015 05:17:57 -0700 From: Derek Morton To: intel-gfx@lists.freedesktop.org Date: Wed, 20 May 2015 13:17:55 +0100 Message-Id: <1432124275-7600-1-git-send-email-derek.j.morton@intel.com> X-Mailer: git-send-email 1.9.1 Cc: thomas.wood@intel.com Subject: [Intel-gfx] [PATCH i-g-t v4] libs/igt_core.c: Fix compile warnings in igt_core.c 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 Fixed variables incorrectly declared as int instead of size_t. v2: Addressed comments from Tim Gore v3: Removed 'unused parameter' changes v4: Changed to size_t Signed-off-by: Derek Morton --- lib/igt_core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index 8a1a249..f24b09e 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -1104,7 +1104,7 @@ static pid_t helper_process_pids[] = static void reset_helper_process_list(void) { - for (int i = 0; i < ARRAY_SIZE(helper_process_pids); i++) + for (size_t i = 0; i < ARRAY_SIZE(helper_process_pids); i++) helper_process_pids[i] = -1; helper_process_count = 0; } @@ -1122,7 +1122,7 @@ static int __waitpid(pid_t pid) static void fork_helper_exit_handler(int sig) { /* Inside a signal handler, play safe */ - for (int i = 0; i < ARRAY_SIZE(helper_process_pids); i++) { + for (size_t i = 0; i < ARRAY_SIZE(helper_process_pids); i++) { pid_t pid = helper_process_pids[i]; if (pid != -1) { kill(pid, SIGTERM); @@ -1376,10 +1376,10 @@ static void restore_sig_handler(int sig_num) static void restore_all_sig_handler(void) { - int i; + size_t i; for (i = 0; i < ARRAY_SIZE(orig_sig); i++) - restore_sig_handler(i); + restore_sig_handler((int)i); } static void call_exit_handlers(int sig) @@ -1419,7 +1419,7 @@ static bool crash_signal(int sig) static void fatal_sig_handler(int sig) { - int i; + size_t i; for (i = 0; i < ARRAY_SIZE(handled_signals); i++) { if (handled_signals[i].number != sig) @@ -1481,7 +1481,7 @@ static void fatal_sig_handler(int sig) */ void igt_install_exit_handler(igt_exit_handler_t fn) { - int i; + size_t i; for (i = 0; i < exit_handler_count; i++) if (exit_handler_fn[i] == fn) @@ -1521,7 +1521,7 @@ err: void igt_disable_exit_handler(void) { sigset_t set; - int i; + size_t i; if (exit_handler_disabled) return;