From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f73.google.com (mail-ej1-f73.google.com [209.85.218.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 3868E37AA72 for ; Tue, 24 Feb 2026 11:44:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771933459; cv=none; b=sXtJOhxyOli6dxrmMbzugNQktZ8dmynfkkqMi+MJSRBuPM1fp5gYrSOPij5/0Fde7C4PgCWbEN1+ce1WTtWtvICIIFKpKaUk1PxRC+V5S/9ek1ZL7+vurV8le1kRUmqofork5XcFwuJQoNdu1w76cNMXFfaNV7G4zaIRuyfnCaw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771933459; c=relaxed/simple; bh=/yhCfYp3uMxvk+kNCDwHyWBEWKd/5Wzgl2bOPy7rkU8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=T8nJwi9Q83xIIDQFXytwtJnsnnPyMl457QzQwsWnXMxXO5/Bau8pfbPomgcCZQMZ4hvlMnaYaIeGMq4OueU8r0aA6CoEiKtZN4+EtuuiFVoxPweVakJT1HrP+kdWBXnilzjmPHt+YyFfhse/0HBZs3rmMDyj22337+09xJhmDrA= 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=LV486YmL; arc=none smtp.client-ip=209.85.218.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="LV486YmL" Received: by mail-ej1-f73.google.com with SMTP id a640c23a62f3a-b844098869cso536222166b.2 for ; Tue, 24 Feb 2026 03:44:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1771933455; x=1772538255; 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=3ZBFlb6hySeXrec0X1VAfrRDStvY9nOhd/jaZZEDq/o=; b=LV486YmLf+kUPo9DSeYH2qyATsZyUO9LCA15JTwwjlauJNORoOnP0GSnEa8u2NwVSl lNcD76znaW1zlhGj0KWvqEv/xOG3jduPYm2cGouc5va0f/8LbsX8gjoLDYy8uwxdnO0l EizQ/Z1vVdYpZIJZnf75H8aMr35F5jdOMb631OnlQOC/PFtO7sobfTUS4HvvZClu2z2u sQVqZzmOpkNTymaiMQHpzI3Bt+U5+iqQqzIyQ2tuTh+a1hhQjAJV+WBnGc8wLiZ/cJak ZkKZo1B1vOQL2kIJ1t9JjYTuIvytkSASNPGz6WWv8B7rPMRqhyjmNuY0TOq62pB3gXUR 3JIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771933456; x=1772538256; 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=3ZBFlb6hySeXrec0X1VAfrRDStvY9nOhd/jaZZEDq/o=; b=XeM29u1eMnz3naQxWs1fU25nvJXCeXhvXdcvVsOFvbuu/O/guNxZCI9KVO9eUjTmFi Kx+05dF0F4MEwER2+mV1Zz+FBFvRWEmHh3koCDzR6ibPn4UC1uU56Y69JwBGV55La1Ie mwsaveyc5xdWKgGhOZWafxngd6jKB42eXp0ECe7yp32DQyQuY14eKlNOqYnPIQNFlQtr pnvL/cN7fnEjuHgnl65ZMKA7iSmakbOaUDJZ8uLNWtbaiV+zp4DTsavtoz7CHfGdB7aJ K4Nx4QMNYq0KxqOJPi8RFs2PMhJNiAhhelH5IzY8EXFNggoZ3cLD6HVFL+y4y83u+5oL 9PwA== X-Forwarded-Encrypted: i=1; AJvYcCU63e4k0djke8Cg4Oplai9CqUP6SaP2ZGpnFll3gRb5ACB0TTVTUd3nB5k4uE6R7ff1QfvKDynTeUD3XQ8=@vger.kernel.org X-Gm-Message-State: AOJu0YxnOBH7RLD0k4vBlXV5tE/ijo20x/k3y5yMYPmfanBi6PatLrHl r5ELjE5D37TJXGgM4pqgJOUlJVnCxa4v96JJ9YU76pFMuFHPWJRQdMsJ1MdfH0RyJsavSqerkRE IcalY0zs1Gu+9aiw8BQ== X-Received: from edxk21.prod.google.com ([2002:a05:6402:12d5:b0:65f:35ce:f5f7]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a17:907:fdcb:b0:b72:58b6:b263 with SMTP id a640c23a62f3a-b9081bfe5b1mr618915466b.60.1771933455483; Tue, 24 Feb 2026 03:44:15 -0800 (PST) Date: Tue, 24 Feb 2026 11:44:14 +0000 In-Reply-To: <20260224-unused_var_err-v2-1-337f9359d98e@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260224-unused_var_err-v2-1-337f9359d98e@nvidia.com> Message-ID: Subject: Re: [PATCH v2] rust: kunit: fix warning when !CONFIG_PRINTK From: Alice Ryhl To: Alexandre Courbot Cc: Brendan Higgins , David Gow , Rae Moar , Miguel Ojeda , Boqun Feng , Gary Guo , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , Shuah Khan , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" On Tue, Feb 24, 2026 at 07:37:56PM +0900, Alexandre Courbot wrote: > If `CONFIG_PRINTK` is not set, then the following warnings are issued > during build: > > warning: unused variable: `args` > --> ../rust/kernel/kunit.rs:16:12 > | > 16 | pub fn err(args: fmt::Arguments<'_>) { > | ^^^^ help: if this is intentional, prefix it with an underscore: `_args` > | > = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default > > warning: unused variable: `args` > --> ../rust/kernel/kunit.rs:32:13 > | > 32 | pub fn info(args: fmt::Arguments<'_>) { > | ^^^^ help: if this is intentional, prefix it with an underscore: `_args` > > Fix this by adding a no-op assignment using `args` when `CONFIG_PRINTK` > is not set. > > Fixes: a66d733da801 ("rust: support running Rust documentation tests as KUnit ones") > Signed-off-by: Alexandre Courbot Reviewed-by: Alice Ryhl