From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63CE230DECD for ; Tue, 18 Nov 2025 16:26:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763483199; cv=none; b=WWUX55IBvacesv8LNHEMMRIAhXc7Vg3YJW+1oUFxCx3SIjQaM3yGvAt4x49ZhuDtP1J59ZyUMMZyh8xXT0oJrCThl1dXbQ9GLFakTiJSB6P+oP67FWc44231ECymeLDtDATThVCdk+YchnOtpTxG46ykYNyUp2oLOj+Fr4Uu44Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763483199; c=relaxed/simple; bh=t0fyfdxYhNgBFmShehvP44pj6moSlFVVPb8XbdW4o6s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=SMB1c/O3OKroC+KTT6e4FlCBMFuZdFptftPrLIV81mqjtjfZDmvnZK/IEaO+TKiQbib9Nz8JbSsm1xjVv3tz0qkqOMRpBmcGP/qSnI2KLi2VMtHtk2SKABrdJyJs0GZMLQ0O7kR8fBMRqfv1oYnsIYCnAs504V20dBmFqf+uu7M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RhEbiA95; arc=none smtp.client-ip=209.85.210.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RhEbiA95" Received: by mail-pf1-f195.google.com with SMTP id d2e1a72fcca58-7a9cdf62d31so6940468b3a.3 for ; Tue, 18 Nov 2025 08:26:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763483198; x=1764087998; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FPQvf2fJRZLygWkfiBo5LquDd0bEFe+7G+i8V4JqB1A=; b=RhEbiA95Gp3g16qkDij7Ilrr2gqGQABey8QDlRHiH4FU62OMzvBzx8ir+OulfD5tph D52jBys8O1lOXmT0F42Y7NWaVBu/Xtq1CV/fq4IFjc8jUZcziQNFNjmqFb7rxNy6gLgn wK6I/fHTgUgC/vyUwiEfyfbZDhA6yI2msdYPYousKlrP8wiGxIV/tlv4JLqBk1a8ZSta QWq7uhuMtdUlwzeeilci19nODo6ovJxUnFDMaZqypygXl4wp00ooYqayRbXK2RBy1i6P TDM9+0f9hSqdlZAFb6Z7CVAdondk8tcUZUwmLrfne9EL/4/nfwTSAcE75LEttnPtxtkK FpLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763483198; x=1764087998; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FPQvf2fJRZLygWkfiBo5LquDd0bEFe+7G+i8V4JqB1A=; b=JQ436dVNNApth2LgbWnLjjtBSCKon4e+N32fhf+Qq1U92j539FhGYNPzTVwYrMU+U/ prc0jmc5RHyf+ktJ0eJmEvRKgvmff2/PGD7BqpmhI7h+IFmRjMxtwAXfM33PivQ8EKgf whhgmbMWK/4RtkxKIjR3cfhyp7hl8al72m36wnSWEkxMa7DPBB7q8UtxQCT89z/X9cOO LRRXKul0vueUKYqJLINhvAQKfmnhnNLoMjE2X5D82IYgc5vxM8Bifj6R/+uKkLaEHix8 ogZvN6CpsYrCvqiGyxYYCh79a5u4BRzXQrbGSVpHIlKlwADCh8lQTy5DMH7dKi4JRMaC lMcg== X-Gm-Message-State: AOJu0YyZCJinewxY6Y9GkJQttcdpM3hZOaekbesx57WDHLGgsRkrzlwR 6/4CAPujQzRGBBGi0mnzu5MDVr8AWSnqRMIm8d2zNO0aQZyx6eKOba/S X-Gm-Gg: ASbGncvKOt+/D0aEkxSCI+HIehHI0MBLWXLjnobuE5egyI6FzrrwThJdC7F+8NASFOR bJ24oPd9zgS5+tMHOPrVSncDdVDTGyzkX0sSBEoqL7SDRgto7YekDm8vKh7EAZ0fl3bgzE1VNHP spYf2SfthyZUPmzMOv9hv4/JhrvD+MiGooXhhnFyyQsN79vO+N2fBbnmZpYGYx3CosboxgbV3Va 6ca8j832fn+wf8U/VPDBk52rFMhncGLVMYl+0eEtWNVMyAfMliWm8h1KPMTQD7OgOXtFxmcRLfd uzEife2NvB/dBp6qOj8g7Ud/TZAuLFkqlKBiOvWe2dZaKS8eSNVaZjFU8cuqduXdhZ5gyjaX6BP p++Np/D5jClvMzoDGTE8c9KhfaZcDHmSOmeyYMa4T8MDXbrgChulm6cndw1B4jcahBE7xHB8+K1 wID/Xlf26NGjU/l5B8lsY= X-Google-Smtp-Source: AGHT+IExnN5/CvNTXvJarfjTKsDl977Q2/s/AGjrE0qQoqK+RhFoIGWV/hP+DhY09MKJIFf9WsFWeg== X-Received: by 2002:a05:6a00:2443:b0:7aa:9ca5:da9c with SMTP id d2e1a72fcca58-7ba3c4755d7mr17508039b3a.22.1763483197640; Tue, 18 Nov 2025 08:26:37 -0800 (PST) Received: from fedora ([103.120.31.122]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7b9250cd969sm16992718b3a.23.2025.11.18.08.26.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Nov 2025 08:26:37 -0800 (PST) From: Ankit Khushwaha To: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , andrealmeid@igalia.com, Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Ankit Khushwaha Subject: [PATCH] selftests/futex: Fix storing address of local variable Date: Tue, 18 Nov 2025 21:56:14 +0530 Message-ID: <20251118162619.50586-1-ankitkhushwaha.linux@gmail.com> X-Mailer: git-send-email 2.51.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=8 Content-Transfer-Encoding: 8bit In `child_circular_list()` address of local variable ‘struct lock_struct a’ is assigned to `head.list.next` raising the following warning. robust_list.c: In function ‘child_circular_list’: robust_list.c:522:24: warning: storing the address of local variable ‘a’ in ‘head.list.next’ [-Wdangling-pointer=] 522 | head.list.next = &a.list; | ~~~~~~~~~~~~~~~^~~~~~~~~ robust_list.c:513:28: note: ‘a’ declared here 513 | struct lock_struct a, b, c; | ^ robust_list.c:512:40: note: ‘head’ declared here 512 | static struct robust_list_head head; | ^~~~ Defining the value with static keyword to fix this. Signed-off-by: Ankit Khushwaha --- tools/testing/selftests/futex/functional/robust_list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/futex/functional/robust_list.c b/tools/testing/selftests/futex/functional/robust_list.c index e7d1254e18ca..d1aab1cc5a37 100644 --- a/tools/testing/selftests/futex/functional/robust_list.c +++ b/tools/testing/selftests/futex/functional/robust_list.c @@ -510,7 +510,7 @@ TEST(test_robust_list_multiple_elements) static int child_circular_list(void *arg) { static struct robust_list_head head; - struct lock_struct a, b, c; + static struct lock_struct a, b, c; int ret; ret = set_list(&head); -- 2.51.1