From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f74.google.com (mail-ed1-f74.google.com [209.85.208.74]) (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 1DD6132E13F for ; Thu, 20 Nov 2025 10:54:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763636094; cv=none; b=nbqEoPMOHl4sgUXw5jsABxm4krquI8GLNckXn2ALWL2kMhoJGv8m10jtBI321m9jeoBxU9bNNaTn57HYiP+RG7J6aCAEtKXyrlKTwprfgY06+QF1tCtIO2MnBtavUELLy/6NEgweiCOhITD2WUmJUFZtUXqWaDa+Ef4NmilSyLA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763636094; c=relaxed/simple; bh=VcZczHRii7P42Dh7vHYaf03fIor4sYyqBSnONy8XpHM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=pGzO2W7cVmfodkrfvP7rTUK40jlD5dFIyNqEUVN6nleAw0E2Ajbe9I/OwWwjb0BDWQQsxzw1P5WsxnWDud/Wi2I3ZeVhak42XeJT3cmbx0ThrxUqC92xfdoNLW6pHs8TTWBIN10uHLGtFoHllNY+1KEg6SXcJqWBIR7GMMxOTww= 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=xWOcoqYw; arc=none smtp.client-ip=209.85.208.74 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="xWOcoqYw" Received: by mail-ed1-f74.google.com with SMTP id 4fb4d7f45d1cf-64160e4d78eso777485a12.0 for ; Thu, 20 Nov 2025 02:54:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1763636090; x=1764240890; 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=UWC2vUhoiQKT9HWF9RvAPRGaUzQ0E39nhqwqb4Wbiss=; b=xWOcoqYws2KpNUotW8smS4DOvtQpIQ/d4LQ0vv639lwVqOoX/GxII1pzyHfSFgk4BQ auo/vuO3WNN4esnT9aRUjJGM1VhGCdXNx3XOmQYhpu9vOGu+ZbBgjGrwaFQfvoRVfrZx cUbaLzzC7dPi8/Ii6RrLVOlwn8oZjRK6G3sUzNPt/9uX+0vNKI8vJpNRn5PMPrAvg+Rp GD1X6fgIWpjl3rHkf7nDp26bK3c+G+sh14RPYySgeg/DjiRFsXgLudQBUaR6/3PRng7V G+/z1viCJOCPIJ/1KjNuUnmHBzAdcwhRegqJXD0Rd4ZqZAl4Ps1g6tSKvK3e47g52K1M aitQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763636090; x=1764240890; 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=UWC2vUhoiQKT9HWF9RvAPRGaUzQ0E39nhqwqb4Wbiss=; b=lZZGuHpDhlj8ITL3dEV84tasAaa0QGB0kUTiPwwkUx6vJP4VUUPu1HeJIxYgCsgD+t f7s4JIJl0MFTh5q30kFR/YtrIKYmoR7dWAt7wBXqH8/y6kWupv6wLUAxonmHVMI11MEK lvBRTt5McfuOvM36hMweyM5a15EX/gru5TMCGqudJDBGdhrzrj2MjKUy06dd4619aP2L Al0PO6jdsKVuO5TNsNDzF5YAKm4BhyzxDpp73Oh68xozmAjsAYDdm9JrFIi8fLt9idlD s9/IHQRXUI/GE3mpf49te1gnReybOf6IoDY8WQ2EtkaFmez0HamVq4dyskaqPIGy1eQ2 qrOw== X-Forwarded-Encrypted: i=1; AJvYcCX1Sxp+Jvzxvph5p3XGHR5o+xitdKRVQEGQ7o3lFp7m5JNTEwZDer6hDlcVV63qMtcSxvJIReowRtrW6XQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yy8eP9a4uV0vVO3KSKNuuUReFAB5E1IZxVEOQbgXje9vifoqNCy jenJpaQ2rwDvuEpuxrdCAyOZX7SAx4zAPKAFvmDz3M/+7SfOeDeuOJH/Puhd/N54AaAm7rxeiD+ Er9xROBHwEuOcXG9VMw== X-Google-Smtp-Source: AGHT+IGliQxOKFQqN9h5kfToOYWOfJDypiYEqvzX7eAWx84z4F4174qDJV6PGp2krjM4J8oh1xrGD724VU7L7cI= X-Received: from edp1.prod.google.com ([2002:a05:6402:4381:b0:641:661a:2bff]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:3909:b0:640:b3c4:c22 with SMTP id 4fb4d7f45d1cf-6453645a4e4mr2260374a12.18.1763636090330; Thu, 20 Nov 2025 02:54:50 -0800 (PST) Date: Thu, 20 Nov 2025 10:54:49 +0000 In-Reply-To: <20251119-rust_leds-v9-2-86c15da19063@posteo.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251119-rust_leds-v9-0-86c15da19063@posteo.de> <20251119-rust_leds-v9-2-86c15da19063@posteo.de> Message-ID: Subject: Re: [PATCH v9 2/3] rust: leds: split generic and normal led classdev abstractions up From: Alice Ryhl To: Markus Probst Cc: Lee Jones , Pavel Machek , Greg Kroah-Hartman , Dave Ertman , Ira Weiny , Leon Romanovsky , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , "Rafael J. Wysocki" , Bjorn Helgaas , "Krzysztof =?utf-8?Q?Wilczy=C5=84ski?=" , rust-for-linux@vger.kernel.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Content-Type: text/plain; charset="utf-8" On Wed, Nov 19, 2025 at 02:11:24PM +0000, Markus Probst wrote: > Move code specific to normal led class devices into a separate file and > introduce the `led::Mode` trait to allow for other types of led class > devices. > > Signed-off-by: Markus Probst So it seems like the goal of this trait is to support both normal led and multicolor led under the same code. However, it seems the traits involved with this are pretty complex. My primary feedback here is: please consider if we can avoid these complex traits. How much duplication would it really take to just have two Device structs and two LedOps traits? I think a few pieces of duplication would be far better than what this patch does. In fact, I'm not sure you even need two LedOps traits if you did that; it seems like you could even get away with reusing the trait for both cases. Alice