From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) (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 037811A3160 for ; Tue, 25 Nov 2025 05:13:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.196 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764047633; cv=none; b=GCcO8JuFVbA5rXYzXVPw0Gi/a7ez3hH3fjDhG7TPLwMonxBUZmCMHJsH8O4+P3KFSj3+FtsDCfuCQQ2KXEZR9PLItpWPDvXTxEEPsaaAa+PiP0NX9ed68O4sLe0akvuNZHWT7KnzC8JlozazeFnM3uz6yqws4drM28HCey6b7OA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764047633; c=relaxed/simple; bh=bZCH7yqzUxRb8N+fb0N0tZDwqqhKG+widKps1KrkSjA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=CYk5I0rPEYtBKVBG6zPhGFJ4se0t3+L8KQzsbKI05TApRAnd556CjB0e3oU54MLUnpF/rfd7ug9X3ku7LS0UgG1YdiR35MONJXfRvIDYG1eG5kHzrnQNBjq0t4BWt0ya4b14p941DszQjbvI1HrQwOUx7Z6Zwr2u6YYbIz3ikTw= 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=ff3o7Fdh; arc=none smtp.client-ip=209.85.210.196 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="ff3o7Fdh" Received: by mail-pf1-f196.google.com with SMTP id d2e1a72fcca58-7b80fed1505so5851797b3a.3 for ; Mon, 24 Nov 2025 21:13:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764047631; x=1764652431; 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=HWcTQTFJDmjwTmMI6RHt8vv+BjL4lU6e7yLMo4+/Cxk=; b=ff3o7FdhABPhk7N75oh4En2PtAAvPhuO/bo7nsmhk7ECE5Kr254aVTMXLaJ+ZTV+To LlV+NEMM26gLoS1X5ekiqF2+nZuavESP6iJA1Lx6AfZCjz7Vtgqx5Xxxm+iSqLI14nxu TZJ0XzTfJpi5S50o7BbUmnEQu2S3sMwFCjK0tbdx07uuIx1Q6b5WFRNGO1HbKD7tXo3p 2cJ6xM4j4IO5MHynkqN8bee76j4CsHf9vyodMecqifEvBpDjNUk6SXJpgNJheUrtf/Hj 9wr3f9+5RpupgYtKeEPIOgE1G7+QMRHO00T98PgenFyl5s9HSH9ofyOXCiErDgQF524j jOxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764047631; x=1764652431; 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=HWcTQTFJDmjwTmMI6RHt8vv+BjL4lU6e7yLMo4+/Cxk=; b=CqQ9r4Q/kqF600DhAIz5cOZH6PoAPcFXtUUSrlmJDH7jOA+0uYgyum+WkucQoXzXFW PtKPTI9X7peB4I5kj4A75+EbmwqDSQUG231WlDlV98tpWP28KVTniKON5s7KiNq6AHf2 DWvVIsPq3oUIE3dQCV1qBN9Zv/jnZZJqUkDAUJnKFyXWpihpYXLXisOE31J6MxdDwi7z FPnVYvabqYRuGEMzL3pSlZ55NSQB1KnKMTneKR3HT842EKzbmGXbLW+RK7m8XyO0HZDs FykrpeX4UGInUVaGDOFVeEq4Of/YtnVt/zReloVELw8xDTbFvuB5AxD6UZmIAgJH+Qs9 CVCQ== X-Gm-Message-State: AOJu0YzkCL/rIiDsEniHPB4VYFs3VqZcMqiWxRjNj90Us1hd0/sT/zI+ y+U+VYhGkK+V+ihTJYUzgcmHwaidPYtAZgWDKJB12dco9MNqRi29X+Xk X-Gm-Gg: ASbGncvhWYY8I0oi4UUGx3GWhE6IDkAN0EkfBTu3/t7wHMJYy0AWHRKPLYbqSGP33aE 7h3IMJHU3oxAzOZmthf4v/K/OlzpTk8adAoJsfmelVlWM2Ons+HRKVabvbKBK+b3GtcfitVoz0p Pjj0BDrpaL3XhFzlah95QkpRf9BckB/7PsPD8OW3v3QybuDUbrPUfy5yWS09sE5D7d80/v1G9fr tZ7eqmvNVA14toiQJogTQhXKNO4k8hqF6A6dVkRpyeObyFWbM0Cv+tMAFmPGCgM4SjQDjewiBTj j0MTl+2X4BsqsfO7itKUkA/76wBY2k+B+pIjtI/cQJAOUzVTz6L8XKUpA5EPU/P34//Q2hvedi0 td31fzNuFP8jmViVMMkhO5oYXFINNE3HRvonJdktN/N0sC86/giQ2OFmca/1esTGhoEY0rquAVs 7T823Jddy5CS/cd5M/VxIIr5/roLBiY9n3wlvMx95B X-Google-Smtp-Source: AGHT+IH/gIpciE5ACSuE2SGrQ53ZE8y7s//19BPgNKgoXxOc+Jz5/qMMSMwR9ixs4i8E4Y/VwD7sIw== X-Received: by 2002:a05:6a20:729e:b0:35d:5d40:6d65 with SMTP id adf61e73a8af0-3614eaf5281mr15973427637.5.1764047631213; Mon, 24 Nov 2025 21:13:51 -0800 (PST) Received: from fedora ([103.120.31.122]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-bd760fae9e2sm14873726a12.31.2025.11.24.21.13.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Nov 2025 21:13:50 -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 v3] selftests/futex: Remove static keyword from 'head' Date: Tue, 25 Nov 2025 10:43:26 +0530 Message-ID: <20251125051333.17934-1-ankitkhushwaha.linux@gmail.com> X-Mailer: git-send-email 2.52.0 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=y Content-Transfer-Encoding: 8bit 'head' is defined as 'static struct robust_list_head' that stores the local variable of 'struct lock_struct a' raising the Wdangling-pointer 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; | ^~~~ Since 'head' doesn't need static storge duration, removing the static keyword of it to fix this. Signed-off-by: Ankit Khushwaha --- v3: Updated the patch name and msg as suggested by André. v2: https://lore.kernel.org/all/20251118170907.108832-1-ankitkhushwaha.linux@gmail.com/ 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.52.0