From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 A15172E762C for ; Fri, 10 Jul 2026 14:10:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783692633; cv=none; b=q4hk1PpeMefwPo0FqeTZee2ZACP5OTCIHD6xt84rMnLA6Nyu5Oz9oAgycVFt42D0Ujd3YB9IbUuZIYeUiELPIOZpQLCc+ouYD/+Rs8ouWOYKh1BXUlot0AOdgdyMPIn+mErWaFi048N5zFOVH1CD28vD47JMmqBYLlw/NbEvwqY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783692633; c=relaxed/simple; bh=ANjkctNcuMAImXrJGww5k/0C1OC8Sw8gShkszAutm/8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ZFT3+TvxcNYIkh2fm5KS2eH42YECUgDKh/cuXPMKyrlb6EmIRRv3MxVaCYFU9lM1W48zmyiHAMwsjpB7K57ywadece+IPK6vJIpLzuQMhEDl6Q2JiZTBP/1Y/nKLcFqTBDZZ9JFW0y4Jp4Fb1D82aY6ggFdabXZkirnJZ+oSgoY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Iv499Orm; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Iv499Orm" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-493c7902f47so8933365e9.1 for ; Fri, 10 Jul 2026 07:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1783692630; x=1784297430; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=cqZ0l6LzRTJPGQYgWIe1BLhP428UFzV157W6gh6Hzlw=; b=Iv499Ormvk/t9jG8PTMw0ZpCupyNlJ2A+k9Ha3LXTGUFV+Z2pNgPlNoGXczSSTeoQx 2MyCJxTJrpn0t7PQhHO6NHzs2JVXmXOHIkUQ+CIZwDAN71pY6nodP9B2laNxHx5ouGxw cUBK0gs/9GDy0oL8VJI23HUif2zJvYkzANECGwkvglkyooXOE1mA0DlJqvRy9/q7tNTC 2xnbRNsP/d0ciCFSidchYcktyFpdPa6jmuZwiOZmWTSc5kVU+54EMpOxb61YIsif8Ema PRTj2tptR6hpcJ20hnH/lhVWtF0iROK7LmWg9B/0ZytxK4GhuKYJZ7zv2hpxeqlLCQL0 D/Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783692630; x=1784297430; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=cqZ0l6LzRTJPGQYgWIe1BLhP428UFzV157W6gh6Hzlw=; b=ijMXwo2DtJLY+QusoU/X2udtIEZ9w22QYeWPzQGINbtHwJwhJZIxev7nufQQNUaTCB qeAydPwz0UV7uFxiU7M5UnsRH5sEnf9YNZKleR/nrhYRw8meLClX3yNS2YK1SyQuE8yj is0iNyARz+Hn6A5OGl4IcRMtRAdbh3ckfzPhk0pTkt7kSkCtE4kspnzv8SB+3iCL9hxX SUMcgn6j75ZLWcifR8wOwlnwz1YBCnSkhE9Y/UhKbZiDsPlGmd3Tek8QPSli1dcBWgjT oSRhdDCcEorhlXHYOFbuk4yShTUqqESeHX+I4OsHb5PPFouPsLGd4KUgtzkZDNPoyFWG /GIw== X-Forwarded-Encrypted: i=1; AHgh+RooTzf9jzTiXGdt8PevO11/K0BIdBFwcTn3Iv07tjJ1Cj2pEbE4PlJk81eiQ2Y6UfqSefhb59pBQu42kWg=@vger.kernel.org X-Gm-Message-State: AOJu0YwoY6+2pLL7EPzWUUWycpyQ3+oYifxmweNrjQppcxA6V2IbJL9M LL1wSqorQuJCxyiJkGtSXF52iDL+dEjg+QsOo4T+Y9d2lU/OJzxF/6qaU8cUDlrxxj0= X-Gm-Gg: AfdE7cn+ATPq7RPn1D8PxBWaOag2zBBUApRlaO5eT7dUeztjtY0rRbD9njTJmTRhupW YDCLLNm+z/vJhe1sCebi/akrtK/dLAhsGamGCGMWLo81PNdbhngcHDM9C4igbu4i40nGN8ESxW9 PoUbDClrHH5ShVOcjydyj38yFHzciK5Br7rgntK6+xUkXwua0OSXI/NCWuelSvz3lu65rken+10 JrF5qClcfLTVGFYjE1jgTUyYbvfpN5OINUkyxmgxn2/hE4FyTKiEJii/0tg3A0BWkmesxYKs+BL 9wVzgIf5RoP+SF16U2YzAXrsrnx+8KXtuIoEmepN515pto7D/be5xoR3iArtPJqg5lrQEI6BSr3 cxS4sFbdLvUN+LiYDfqKMzrG/qihDNqtBpNuK0J50GAd36ZI+aaJp+zPFSHUZ9X/kPee/6p+VR1 qmUOpmw63exMvwGQeKfzRCva7QqQip0xubgQ== X-Received: by 2002:a05:600c:c3cf:10b0:493:f0f5:f2dd with SMTP id 5b1f17b1804b1-493f0f5f491mr42550385e9.21.1783692629973; Fri, 10 Jul 2026 07:10:29 -0700 (PDT) Received: from [192.168.42.79] (nat2.prg.suse.com. [195.250.132.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493eb6e8844sm156565475e9.10.2026.07.10.07.10.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jul 2026 07:10:29 -0700 (PDT) Message-ID: <5b8b72b2-f832-4fb4-8fb4-9fd16b96b902@suse.com> Date: Fri, 10 Jul 2026 16:10:28 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] rust: module_param: support bool parameters To: Wenzhao Liao Cc: mcgrof@kernel.org, da.gomez@kernel.org, samitolvanen@google.com, ojeda@kernel.org, linux-modules@vger.kernel.org, rust-for-linux@vger.kernel.org, atomlin@atomlin.com, boqun@kernel.org, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu, dakr@kernel.org, linux-kernel@vger.kernel.org, Greg KH References: <20260411130254.3510128-1-wenzhaoliao@ruc.edu.cn> <20260411130254.3510128-2-wenzhaoliao@ruc.edu.cn> Content-Language: en-US From: Petr Pavlu In-Reply-To: <20260411130254.3510128-2-wenzhaoliao@ruc.edu.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/11/26 3:02 PM, Wenzhao Liao wrote: > Add support for parsing boolean module parameters in the Rust > module! macro. > > Currently, only integer types are supported by the `module_param!` > macros. This patch implements the `ModuleParam` trait for `bool` > by delegating the string parsing to the existing C implementation > via `kstrtobool_bytes()`. It also wires up `PARAM_OPS_BOOL` so that > the Rust parameter system correctly links to the C `param_ops_bool` > structure. > > For demonstration and verification, a boolean parameter is added > to `samples/rust/rust_minimal.rs`. > > Assisted-by: Codex:GPT-5 > Signed-off-by: Wenzhao Liao I've queued the patch on modules-next for v7.3-rc1, with the following minor changes: * Added a short description of the motivation to the commit message: Support for boolean parameters will initially be used by the Rust null block driver [1]. Link: https://lore.kernel.org/all/20260609-rnull-v6-19-rc5-send-v2-4-82c7404542e2@kernel.org/ [1] * Rebased the patch on top of '[PATCH v2] rust: module_param: return value by copy from `value`' [1], which required removing the dereference from '*module_parameters::test_bool_parameter.value()' in samples/rust/rust_minimal.rs. [1] https://lore.kernel.org/linux-modules/20260601-modules-value-ref-v2-1-12ebbf0510c9@kernel.org/ -- Thanks, Petr