From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) (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 C74483A79D7 for ; Tue, 18 Nov 2025 17:10:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763485825; cv=none; b=qkmefxTiDCcZ87//HP4+inXRvNWs37CmvhSzt3BSeni9ASnR9tBvXVfphaamvqFqx0Rcbm0OvhnLQqu5P4cib9lOAcaTkx4zUqfAXZmKkxGRKanqGD9P02pcNMJ38Q7XqMIaaH6OLga6C8ZkR16AKZt6vAtDmxmkihTrZO58tHA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763485825; c=relaxed/simple; bh=LDZGL4a3vvv8O1BiYRfiPuGsVbYdd3TRXhA8IpuHpl4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=HDPz1iJt0+DeM83FBkUeqJ+P1XxSGSxpPxfQqgbDe5vQdHJyaOKs69+y2tE0Rx4p1fevke95UBBwIx6tUPzmAnRCP1Xv97rWK8u2NmLztUcI6mPqMeZNqMgmH10J6Wnji/3uoo0fxUC/1jR0lXpVrUwcviGd7dQXTd+Ify8zCXw= 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=OgiMk+K7; arc=none smtp.client-ip=209.85.214.193 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="OgiMk+K7" Received: by mail-pl1-f193.google.com with SMTP id d9443c01a7336-299d40b0845so46093295ad.3 for ; Tue, 18 Nov 2025 09:10:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763485823; x=1764090623; 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=opKHW4snE6AbRbbuPkU9JelehU8sZTSa7jldV99EN8Y=; b=OgiMk+K7HrwvraM9WNKcUdSGGEjH8O9zvy6yOQ3pIk/8Qf0nvO9z7CTrA/QTrirRS4 fC6uQt8dzxSk+BruPCH2ShwshRiW/vZjgczbsgQwtrgPZ0zVSSDIQT+mKySYyb3wa3b1 SFIjjZ/ywbLvsdyz0xzzFkP3M7mJNsw3R12L7GZ5oj6QdFC7439SJ2F8K/BsYzV1twnc 4S6rP3S0RmJHu2biCrjedTf+W7q/WmSXjqrB97fPqTdrz0yuELqORrnhntoefQV/q3RR N3qlcU2YYL55LrJp28w3xo4NbaxC7pcE1JOFdSVMeYyTbLaAY7dXrwem7fdbOKjyYzIm C77g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763485823; x=1764090623; 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=opKHW4snE6AbRbbuPkU9JelehU8sZTSa7jldV99EN8Y=; b=H/zvZMZdJqzwH3E/waAk063aUldTaICNWsfv7wEYUyBpacN3lVTMu1Y5Nv5wNsXf7D vuoqG7lfU+bFXHs/i89fcSQRbvATfgZGJ1RiDyA0yP6UXAQGUtorpgo4243H6qDC8Fl6 NyjPCRXupARo+Ej+G0ilNUiVBqnFP1EvlSej2sxPK8nXdQ9f9xg9bRQsyUp5cpaLyFi+ EIyJqjIQ4wiFVJBKZdRwT/WpOV2BOeaX1O0ZTRxRijw0lcDql6LcLi/tP+J1Zvq+X+l/ 7MD3kCoKHH1S0ZhTmtE7sy4aZVZcHHYR58Jnr+CpgrUKV1MTEFTbgpM7FbCdcDka5CxO GiAA== X-Gm-Message-State: AOJu0Ywrj4DTSWMLdud9aFjxWcxXWXoRUVTFm+BamO7IUWq1Xv4KGb1W jfvSjis9+MG92FQV9dkaWt+hr7isgc6N7KrHIF1hdyMGq/En5bJ0HNcPBWFlR38U X-Gm-Gg: ASbGncuixhRn92vv8CizYcDRfvvolNXmimcyOe/ZlIZpUSm6RR/7Tl6LTTC7C8r93yE Vdw/HNtxUGW9kjvyfWIpyU/FuxRhb5DszaSAuUak3J1kzqoLo7XVUM9+GOre/RgptVZkbsV/9tE CcY/raGMKtHZlojBVs/rUmme9cDIJkbST+91/MPQ/Bs8J1Cq8I3WoL0zuaV28b+jc4FsjwMbrhS 0cZijiF26AkMdL9tz3th+lhZ98q39zhedNpildWf5kmcF1W7oGqcyDmbh2TdfinMASURe1beIuP JjnnIVaVNCXrAPNWGbxTEeSPick2YrxSFNdq113OgPRjpoaD5UEKhLk86GTpWwnnqHR5Zp5NFH1 VmsgDlGz9zNlcK8kYix2CXC+j9DDT6iziTUR9gl9S0gFBLGAOargwXIZZeO9pnOYkFgvyCNxuK+ WgXm3/IWPWMCRNob504gioXhcvE34KMikZ7A1l79s+eNkbm3UfHZE= X-Google-Smtp-Source: AGHT+IF/KaWmF75r7fV6/1/dLuD/8Mw6nF7YF5EqK1ZwOJVDh9j7Np/kDiIrJ8NQOoRAy343jV5yJw== X-Received: by 2002:a17:902:d506:b0:294:f30f:ea4b with SMTP id d9443c01a7336-2986a6b876dmr166505575ad.8.1763485822999; Tue, 18 Nov 2025 09:10:22 -0800 (PST) Received: from fedora ([103.120.31.122]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7b9250d332asm17165019b3a.25.2025.11.18.09.10.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Nov 2025 09:10:22 -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 v2] selftests/futex: Fix storing address of local variable Date: Tue, 18 Nov 2025 22:38:50 +0530 Message-ID: <20251118170907.108832-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 ‘lock_struct a’ is assigned to "" 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; | ^~~~ removing the static keyword of "head" to fix this. Signed-off-by: Ankit Khushwaha --- changelog: v2: Added changes suggested by André. v1: https://lore.kernel.org/all/20251118162619.50586-1-ankitkhushwaha.linux@gmail.com/ --- 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..ef21a7ec9def 100644 --- a/tools/testing/selftests/futex/functional/robust_list.c +++ b/tools/testing/selftests/futex/functional/robust_list.c @@ -509,7 +509,7 @@ TEST(test_robust_list_multiple_elements) static int child_circular_list(void *arg) { - static struct robust_list_head head; + struct robust_list_head head; struct lock_struct a, b, c; int ret; -- 2.51.1