Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp8050558rdb; Thu, 4 Jan 2024 17:38:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDxojdFC4YNMcX7w3CaHfrs7rqkYB99AGersoobGnMCZJbS8Xza+ZYjrKGmLMEWMEPIZhb X-Received: by 2002:a05:6214:528f:b0:67a:8951:cfa5 with SMTP id kj15-20020a056214528f00b0067a8951cfa5mr1489667qvb.53.1704418732225; Thu, 04 Jan 2024 17:38:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704418732; cv=none; d=google.com; s=arc-20160816; b=mlO0hs4VtYp9V5VXQvCNfd2ILWwldeIIF8yCnhMknd764X7QhlIIl4039/DqkJycz6 NgjI/8hhqcm9ZEaCCRCh+h67rYB51ivmLnn4uCCpSQhb3H9oqFS4JQarHpy7aUDZmibI lehv2exQrOUI+XjjlEIDpxy7Y1iY56mjfkzf2nrUcunAw0ZxWYKtDZYZBRKnphHdTGzw W0s5euAqk98Lpu6QxgA3mkIfo2Nzk9fEU2XfR07gnZnVlzfZEp8FjbtMeqOCoCsPWxp8 hWtevBq3yissKrEmzCt5VEK4MS5oqCotFJY0J7HOTnLclN44y07YC7gPQwV3CZTa3sFr jHtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=tqT/AVRgVsILO5PYxve7D7CesOkei1/CmKSdAgtwn2Y=; fh=mPgAxjZbeSlaGLpagAldmvIPjycU+5JODujtarGNoqQ=; b=W8BZJYs1yihxKd7ycqP1Ssux80g5WTC49aKZ5BWk8ep0Yq7rllYuFBpIViEmxpZ1hj Cm+R/3ye8JxarvzoPHVMcyzReWE8vjAd2uub81f3vk9GzPGheaZEBU6nwOxVEFr2UCPY UXa09ky1k2gmr1mIN7cRSxKOqz3NsXJILl6zNeH2pNdA9FFQkBeXMUCu6KZjy2nACq3k lfR+uOri54uUPKVe+tPc8fGPFljC5m0kb1rAck3NZddbRka4OyoBmhb2bCD4pAay3mn2 ruj4LSVAhbx3oooAjYzuHMM5eF7Eb1g0/4COv6l4BbldciPavoxH5qVl79f9C1QA68b8 MpQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=PoaUFHLO; spf=pass (google.com: domain of linux-kernel+bounces-17396-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17396-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j13-20020a0cf30d000000b0067f98484ebdsi755800qvl.611.2024.01.04.17.38.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 17:38:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17396-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=PoaUFHLO; spf=pass (google.com: domain of linux-kernel+bounces-17396-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17396-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 025751C224FC for ; Fri, 5 Jan 2024 01:38:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC6D61FCA; Fri, 5 Jan 2024 01:38:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=posteo.net header.i=@posteo.net header.b="PoaUFHLO" X-Original-To: linux-kernel@vger.kernel.org Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EEE6A1FA3 for ; Fri, 5 Jan 2024 01:38:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=posteo.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=posteo.net Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id E88AB24002B for ; Fri, 5 Jan 2024 02:29:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1704418174; bh=oAoNUgdOzVQyPdIoTkmvZg6pLTo+MPwqhbIwlJ+mDsQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=PoaUFHLO4ggfYDOsm28CktkHfOMXkkmHb0FdJC2irtJEUAjRqwlhd60lTiXJjdGrg HLmeG3CxLNnbOO8hfR2CGqfkWvpei3bKL1dOMb9y1k75MLiv7oSpp458twAWGj3O9T B9aIbRKjQAnAWWm1sHqv2Petl003wePCEj3vrKNJVj9M2cKJn+4MHhIDqMkxqbCgCc /7vLkCcQQgegOnkTIK/xDMARnH+589Mk9a+Qgc/811gNgCRzQX20kI+lcEHFA9aphX D+3psfjMu6ZxypgnZ2y9WngQbplGCuaSec+1Njk+ogJfB+HULCdH4I8LNU7ZWUQBwz VBf2+ZpwHRsCg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T5m8X48yrz6tv5; Fri, 5 Jan 2024 02:29:32 +0100 (CET) From: Charalampos Mitrodimas To: ojeda@kernel.org, alex.gaynor@gmail.com, wedsonaf@gmail.com, boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, benno.lossin@proton.me, aliceryhl@google.com, a.hindborg@samsung.com Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Charalampos Mitrodimas Subject: [PATCH] rust: sync: `CondVar` rename "wait_list" to "wait_queue_head" Date: Fri, 5 Jan 2024 01:29:30 +0000 Message-Id: <20240105012930.1426214-1-charmitro@posteo.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Fields named "wait_list" usually are of type "struct list_head". To avoid confusion and because it is of type "Opaque" we are renaming "wait_list" to "wait_queue_head". Signed-off-by: Charalampos Mitrodimas --- rust/kernel/sync/condvar.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/rust/kernel/sync/condvar.rs b/rust/kernel/sync/condvar.rs index b679b6f6dbeb..ea0d559fbde5 100644 --- a/rust/kernel/sync/condvar.rs +++ b/rust/kernel/sync/condvar.rs @@ -73,7 +73,7 @@ macro_rules! new_condvar { #[pin_data] pub struct CondVar { #[pin] - pub(crate) wait_list: Opaque, + pub(crate) wait_queue_head: Opaque, /// A condvar needs to be pinned because it contains a [`struct list_head`] that is /// self-referential, so it cannot be safely moved once it is initialised. @@ -96,7 +96,7 @@ pub fn new(name: &'static CStr, key: &'static LockClassKey) -> impl PinInit(&self, wait_state: u32, guard: &mut Guar // SAFETY: `wait` points to valid memory. unsafe { bindings::init_wait(wait.get()) }; - // SAFETY: Both `wait` and `wait_list` point to valid memory. + // SAFETY: Both `wait` and `wait_queue_head` point to valid memory. unsafe { - bindings::prepare_to_wait_exclusive(self.wait_list.get(), wait.get(), wait_state as _) + bindings::prepare_to_wait_exclusive( + self.wait_queue_head.get(), + wait.get(), + wait_state as _, + ) }; // SAFETY: No arguments, switches to another thread. guard.do_unlocked(|| unsafe { bindings::schedule() }); - // SAFETY: Both `wait` and `wait_list` point to valid memory. - unsafe { bindings::finish_wait(self.wait_list.get(), wait.get()) }; + // SAFETY: Both `wait` and `wait_queue_head` point to valid memory. + unsafe { bindings::finish_wait(self.wait_queue_head.get(), wait.get()) }; } /// Releases the lock and waits for a notification in interruptible mode. @@ -144,10 +148,10 @@ pub fn wait_uninterruptible(&self, guard: &mut Guard<'_, /// Calls the kernel function to notify the appropriate number of threads with the given flags. fn notify(&self, count: i32, flags: u32) { - // SAFETY: `wait_list` points to valid memory. + // SAFETY: `wait_queue_head` points to valid memory. unsafe { bindings::__wake_up( - self.wait_list.get(), + self.wait_queue_head.get(), bindings::TASK_NORMAL, count, flags as _, -- 2.39.2