Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2484263pxj; Mon, 10 May 2021 04:12:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybG7IjprbBGeG7TtrtWqEMW2c0AEQwJQzIQyscbBmqGsnatiSGe8EmJhfRjxfMR721dbvm X-Received: by 2002:a17:906:248e:: with SMTP id e14mr24415869ejb.249.1620645152561; Mon, 10 May 2021 04:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645152; cv=none; d=google.com; s=arc-20160816; b=Xg5xTe3kJxFTPM0/KoN73DmWlwkaPZBCRvUa0/mFb1TQqGUBOO4Qj8c0ilKGY8gK6K qxkbXYi2dBm+eqzLFodZ4iLJ8Ts8gduj0JdAeb5GPV9wINB/A0XcCDFocKCOa0YDPKjt jVLOfhyHOhtY7OZUVw9BKCxvtYgZ3tsTLAFDav78Qwgvshoub0Ycf6z3+nLNXv1qXEDj sWQHJEaM2vICzwjauSq9kSSjghph8+/PG+/SO1u7CXIIam2zokH0w6l7FywfwZdtvUaN FHhVlUH4AV+HblmD6sRsBmM3l7MTMpuOWI7Jltc6TQCQhYN4C+W3lQtB1Ollpy3BIMz7 8hPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bpPWjOzdb9vFKpyDoxOlzFTG4SUaEFsyp55VdjyMlZ4=; b=J3/93oH9wU8tXLnZa7mWvQsK3BkWKCwgx4GopEw4X1KMvJRM2bdhXtzF6ru9SUqyik 8HvbnLXiDfoR7rlsp3AZQoDXkrdfl7nEwQE6cIUzgP6cWOuq2NiWkadfFbZFRUYifZVa XoT0ruH9ZXgNR8AYM7HFloXrPoJQt9qNH9G0on6k7qOhlBMvK1fAj5Z3ho6KhAR4VPxZ PfCTnbQ2d37nlO0EO47FxMo+M2YFobf7nrqg8tXJw9o9iu0784RKSTlZ8POXkUz24+RF Mxr/Vq65z45wAVq6Ga/ppB1KCWarXsoy1DBjKU/gurkxiTnktmvD5z5fqbUTRuzpSEZQ SXAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hu6jwgac; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si12894989ejh.112.2021.05.10.04.12.08; Mon, 10 May 2021 04:12:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hu6jwgac; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233853AbhEJLJG (ORCPT + 99 others); Mon, 10 May 2021 07:09:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:32908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233111AbhEJKtf (ORCPT ); Mon, 10 May 2021 06:49:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EF165619C6; Mon, 10 May 2021 10:38:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643096; bh=zCIXw1C/sFH1de0h7EkCdQbVW7yzWhOzPy7vGicll/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hu6jwgacQR77L0JRFQHTzuTWWPkdF0kyy8IUq/79M+mU5vW83NwALKRb0F76lzTTd Wu8hCBU70vGj2RWT0I/OIPJId6sL2EwTUTbEgj6DKLBBzwuzRzUOnEeZMTk7yzsgeZ TQ30jL1KOAeVq72xiLKKzPyE6jaoe1x5HNZVLQdo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Reinette Chatre , Babu Moger , Fenghua Yu , Shuah Khan , Sasha Levin Subject: [PATCH 5.10 159/299] selftests/resctrl: Fix compilation issues for other global variables Date: Mon, 10 May 2021 12:19:16 +0200 Message-Id: <20210510102010.209095307@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fenghua Yu [ Upstream commit 896016d2ad051811ff9c9c087393adc063322fbc ] Reinette reported following compilation issue on Fedora 32, gcc version 10.1.1 /usr/bin/ld: resctrl_tests.o:/resctrl.h:65: multiple definition of `bm_pid'; cache.o:/resctrl.h:65: first defined here Other variables are ppid, tests_run, llc_occup_path, is_amd. Compiler isn't happy because these variables are defined globally in two .c files but are not declared as extern. To fix issues for the global variables, declare them as extern. Chang Log: - Split this patch from v4's patch 1 (Shuah). Reported-by: Reinette Chatre Tested-by: Babu Moger Signed-off-by: Fenghua Yu Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- tools/testing/selftests/resctrl/resctrl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h index 959c71e39bdc..12b77182cb44 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -62,11 +62,11 @@ struct resctrl_val_param { int (*setup)(int num, ...); }; -pid_t bm_pid, ppid; -int tests_run; +extern pid_t bm_pid, ppid; +extern int tests_run; -char llc_occup_path[1024]; -bool is_amd; +extern char llc_occup_path[1024]; +extern bool is_amd; bool check_resctrlfs_support(void); int filter_dmesg(void); -- 2.30.2