From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f73.google.com (mail-ed1-f73.google.com [209.85.208.73]) (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 80AF9425CC9 for ; Thu, 4 Jun 2026 11:58:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780574294; cv=none; b=Jtwn16BH7Ve/HqXvQJJJNpJhsQhzMDHeME2epTzklUHu66DiUa2svAgDqR9BV6G2kCHCAD3/Sg/TSPqcYBZ5uYugHx8KGVlMP7d3JkEHHYsCa5MYVp4gfGOC3YG082SPPZls19SxFnsJ1+4X3fJo//iRYksOfGPzAp9p6SxPwEE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780574294; c=relaxed/simple; bh=UVIqVMclZDr4qxCyNWMZ/qWloEXWIhQNsmxjFg/How8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ftSIXn0rXzNbCLhADKORHveWz7zJr9u4eDMowiciSQ0o1fEUMnlN7OuMTgf5swu2YEAeQy4XEGLeqrG0eyozMKX9cYte0YLJUBIhsoXPn9W6yrCOj/cZhTCQBML6EoeJf70+tVWmTwqc9lcPZdSq+T0nAXJJed1mEb4PRDjrQf0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=KpP0bCD2; arc=none smtp.client-ip=209.85.208.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="KpP0bCD2" Received: by mail-ed1-f73.google.com with SMTP id 4fb4d7f45d1cf-68ae236d5fcso746180a12.2 for ; Thu, 04 Jun 2026 04:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780574291; x=1781179091; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=tsDBf51o8QHp6SAQ5/8ziLKktk7y3LjUQBohqdmyxqM=; b=KpP0bCD2b/xDSQtHVikC8bBAVEkCDL8VxDlAKFX+lHSFzR0z81IFlJ+4uzRY/2Hgdh 2inHTu+MDyzjmAaaTOzIWGTkU1fXI5fI3HBEuaXTBUMwvIRRJ+4ekBhknPlqKD37mxGx Le3XPZ5kcn1uVcxkXfDzMhg8LvjCM3c+7p6Bly6Pt3MpzHjj0wmaJYDbLkEkS2vWU2bV 7i+QERjYZPVCQkqgiRkLy7ucx6Ln5Ss9F2TY5VL2t4eTx4j2/W9qzKt64/tmrN69UK/w 6YD296c1YccmGZ3pvIeyU9oeaLG2h1YIlDzmbZfWfati3tijexUr+megDrQB24YwjofU y0Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780574291; x=1781179091; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tsDBf51o8QHp6SAQ5/8ziLKktk7y3LjUQBohqdmyxqM=; b=mdSxYK8yuPPmP3+jMd3aQetNWDyPp1pf8FuXzSe/UzVdIa9tSA3wVAGHv0VaArKIwc GBHQGaH4qAeUp/xgU+muMRksiUA2tZrHIkZMo0v3MR8Zmj4f2Z8/M1j2vmg7Cm8fFcvU e1H79ejsG8FAJkBrUNx3yP1XlReeGsj10z9ka2Hm16ZaJ2kMfVpRbogMm4PagLP9gdAo pGQ4a6eHJzJb5cLByBnymTiL5qVIsldiL5Pjsgzcc6DqdSQBzAoWPbClsSgjTkhqUWWm FO6XJ+gicLrLg+p/As2cN6lLc6xFh21agkqp9hoIPqDte7jnHVTtUUiNGHulAtkNm1TI lxkg== X-Forwarded-Encrypted: i=1; AFNElJ+XaT/oMfvlQUYaJbefXCEE5AkluBI+SuFXmUiSogv2v/cH+SYgRckdorsRZaLEyjF0VPfxUAI1yb0saw==@vger.kernel.org X-Gm-Message-State: AOJu0YypwksVm/6eHmob0Kqkx56193yq2h9FQTken3hMi6RAoguME+Gx TnP5Sntp1rjsPm4wrH4WpMPpPbezLPQw1e1bYyp2bYmGVHVbBH3qLV7psPD2PLgi4nNpNSM1Gth 1I1hPqbfRKZcjknteBA== X-Received: from edrm6.prod.google.com ([2002:aa7:d346:0:b0:68b:163d:99f3]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:27cf:b0:688:1d5:44c5 with SMTP id 4fb4d7f45d1cf-68e6f79352amr4016032a12.2.1780574290900; Thu, 04 Jun 2026 04:58:10 -0700 (PDT) Date: Thu, 4 Jun 2026 11:58:09 +0000 In-Reply-To: <20260603195210.693856-6-lyude@redhat.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260603195210.693856-1-lyude@redhat.com> <20260603195210.693856-6-lyude@redhat.com> Message-ID: Subject: Re: [PATCH v17 5/6] rust: sync: Add SetOnce::reset() From: Alice Ryhl To: Lyude Paul Cc: dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org, nouveau@lists.freedesktop.org, Alexandre Courbot , Gary Guo , "Christian =?utf-8?B?S8O2bmln?=" , driver-core@lists.linux.dev, Miguel Ojeda , Maarten Lankhorst , Simona Vetter , linux-kernel@vger.kernel.org, Sumit Semwal , linux-media@vger.kernel.org, "Rafael J . Wysocki" , Maxime Ripard , Benno Lossin , linaro-mm-sig@lists.linaro.org, Danilo Krummrich , Mukesh Kumar Chaurasiya , Asahi Lina , Daniel Almeida , Greg Kroah-Hartman Content-Type: text/plain; charset="utf-8" On Wed, Jun 03, 2026 at 03:42:34PM -0400, Lyude Paul wrote: > This function simply drops the contents of the SetOnce, given a mutable > reference - since that proves we have exclusive access to the SetOnce. > Additionally, update the invariants for SetOnce to make it clear as to why > this is safe. > > Signed-off-by: Lyude Paul This isn't needed, you can just do: unsafe { (*this).sgt_res = SetOnce::new() };