From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A1EAC4D90DB; Tue, 19 May 2026 10:39:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779187164; cv=none; b=nJJZvg5s8VKojuFE9+fHfqdFMcEZBZGDA5h0p+6kh4U9nWg5IWpCU5UPpC3xgaWs1mArTxhP9bC57MJq9GOrqxxg/UDrc2I2Fz6ZPDUg/VZx0TOyEfTUqwbVBPJ4wBunodRG55L9Wv/qYlq34r63d3oM8Gm+sZsTrdTkjonnveM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779187164; c=relaxed/simple; bh=5J8hmX1CCU0iLcpPMu5NtOM8FHJanErUGlCyNObqAGo=; h=Content-Type:Date:Message-Id:Subject:Cc:To:From:Mime-Version: References:In-Reply-To; b=W0aPMzYGJMEtWJ3nsWgpOjpX2Vg0Z3F6LZGitk6xEsbxITL4RCcrsgy0eWJfemcbJ+jlRNKhdlAp2Cim3xZa8Gbh4OIL4BZ53s6i9hUwUJMq8Ad8bn6LBucQt6jsW6DHT6xfhI+y2Iz3cAdfX73Xv7WTG2G4aBMXi8TG1UVEP8E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WlzyzTrf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WlzyzTrf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32C81C2BCB3; Tue, 19 May 2026 10:39:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1779187164; bh=5J8hmX1CCU0iLcpPMu5NtOM8FHJanErUGlCyNObqAGo=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=WlzyzTrfiapXBcLy/6izyhFaE+Ulg7HRdIMadQ7hTDarGnJnez4IPmK3n3+FbUfEX 0qCGQS2eEE4Uzmqq4tltIvQLCfObxCmFIn2R8idpC/VvAmw8bf751KtnrYk3y8e8xf puwIBSuda04tXtpDp/1k37aHCAp2Nezb0a0TdrIBn7WZ5bvhQnCm4wqetagni4o5yt 1LOWieJIVCn7g+Z7zBAuUjUpGvPSWZG5bpdIqJ3vDjWMLIvurI31NerM+pInCA2fkv QxFzIaYcjvwpYJciL5pSSZlE28Pj5ZYUy4pZHmD0G4HKc4n2nmQnk+kBO1/7a1g4hf j2eAV1vQ7jG+A== Content-Type: text/plain; charset=UTF-8 Date: Tue, 19 May 2026 12:39:15 +0200 Message-Id: Subject: Re: [PATCH v3 17/27] rust: auxiliary: generalize Registration over ForLt Cc: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , To: "Eliot Courtney" From: "Danilo Krummrich" Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable References: <20260517000149.3226762-1-dakr@kernel.org> <20260517000149.3226762-18-dakr@kernel.org> In-Reply-To: On Tue May 19, 2026 at 9:56 AM CEST, Eliot Courtney wrote: > For example, in the next patch on the sample aux driver you can do: > > ``` > let data =3D adev.registration_data:: Data<'static>)>()?; > let pdev: &'static pci::Device =3D data.parent; > ``` > > and mint a 'static reference to a bound device, which seems unsound to > me. Good catch, I applied the fix. Additionally, we could probably reject unused lifetime binders in the ForLt= !() macro, which doesn't help when used with a type alias, but may be a good defensive measure anyway. > What about requiring all device ids declared to be supported by an aux > bus driver to have the same rust registration data type? Please see [1] and [2]. Thanks, Danilo [1] https://lore.kernel.org/driver-core/DIFBME3GXDC0.14UHJTPD6TTAE@kernel.o= rg/ [2] https://lore.kernel.org/driver-core/DIFXM2N21Q5J.2RIYLU11C5FR6@kernel.o= rg/