From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932416AbbCCD1R (ORCPT ); Mon, 2 Mar 2015 22:27:17 -0500 Received: from mail.kernel.org ([198.145.29.136]:44182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756220AbbCCD1M (ORCPT ); Mon, 2 Mar 2015 22:27:12 -0500 From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Adrian Hunter , "H. Peter Anvin" , Stephane Eranian , Thomas Gleixner , linux-tip-commits@vger.kernel.org, Arnaldo Carvalho de Melo Subject: [PATCH 17/20] perf tools: Initialize cpu set in pthread_attr_setaffinity_np feature test Date: Tue, 3 Mar 2015 00:26:06 -0300 Message-Id: <1425353169-21436-18-git-send-email-acme@kernel.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1425353169-21436-1-git-send-email-acme@kernel.org> References: <1425353169-21436-1-git-send-email-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Adrian Hunter 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 Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Stephane Eranian Cc: Thomas Gleixner Cc: linux-tip-commits@vger.kernel.org Link: http://lkml.kernel.org/r/54F41849.1010906@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- 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 2b81b72eca23..fdada5e8d454 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.3