From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753790AbbCBIBG (ORCPT ); Mon, 2 Mar 2015 03:01:06 -0500 Received: from mga01.intel.com ([192.55.52.88]:37318 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753324AbbCBIBC (ORCPT ); Mon, 2 Mar 2015 03:01:02 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,674,1418112000"; d="scan'208";a="461208095" Message-ID: <54F41849.1010906@intel.com> Date: Mon, 02 Mar 2015 09:59:05 +0200 From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: acme@redhat.com CC: Ingo Molnar , hpa@zytor.com, eranian@google.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, jolsa@redhat.com, linux-tip-commits@vger.kernel.org Subject: [PATCH] perf tools: Initialize cpu set in pthread_attr_setaffinity_np feature test References: <1424774766-24194-1-git-send-email-adrian.hunter@intel.com> <20150301165235.GA24700@gmail.com> In-Reply-To: <20150301165235.GA24700@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Feature tests are compiled but not executed, however it might avoid a future uninitialized variable warning, so initialize the cpu set. Reported-by: Ingo Molnar Signed-off-by: Adrian Hunter --- tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c b/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c index 2b81b72..fdada5e 100644 --- a/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c +++ b/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c @@ -1,5 +1,6 @@ #include #include +#include int main(void) { @@ -8,7 +9,8 @@ int main(void) cpu_set_t cs; pthread_attr_init(&thread_attr); - /* don't care abt exact args, just the API itself in libpthread */ + CPU_ZERO(&cs); + ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cs), &cs); return ret; -- 1.9.1