linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: clicedvly768 <harepro29@gmail.com>
Cc: ojeda@kernel.org, rust-for-linux@vger.kernel.org,
	 linux-input@vger.kernel.org
Subject: Re: [PATCH v5 1/2] rust: input: add input device abstractions
Date: Fri, 6 Nov 2026 14:49:58 -0800	[thread overview]
Message-ID: <au5ZLv09L2l3LwZP@google.com> (raw)
In-Reply-To: <20261106223033.452853-2-harepro29@gmail.com>

On Sat, Nov 07, 2026 at 03:30:32AM +0500, clicedvly768 wrote:
> Add safe Rust abstractions for Linux input devices (struct input_dev).
> 
> This provides:
> - `AllocatedDevice`: a newly allocated, unregistered input device handle
>   that allows configuring capabilities (keys, absolute axis limits, parent
>   device) before registration.
> - Safe string methods: `set_name` and `set_phys` accept `&'static CStr`
>   to prevent use-after-free since the input core does not copy strings.
> - `set_phys_from_parent`: dynamic physical location path formatting
>   ("%s/input0") stored safely in an owned kernel heap buffer.
> - Device lifecycle and reference count management: `set_parent` takes
>   a reference count via `bindings::get_device` to avoid dangling pointers,
>   releasing it appropriately on drop or post-registration.
> - Bounds-checked `set_abs_params` validating `axis < ABS_CNT` (0x40)
>   to prevent memory corruption in `dev->absinfo`.
> - `RegisteredDevice`: a registered input device handle providing safe,
>   inlined methods to report keys, absolute coordinates, and synchronization
>   events. Automatically calls `input_unregister_device` on drop (RAII).
> - Constants for bus types (`bus::*`) and event types (`event_type::*`).
> - Alphabetically sorted imports and module entries gated with
>   `#[cfg(CONFIG_INPUT = "y")]` and `#if IS_REACHABLE(CONFIG_INPUT)`
>   to avoid link failures when CONFIG_INPUT is disabled or modular.
> 
> Signed-off-by: clicedvly768 <harepro29@gmail.com>

I am sorry, who??

If you are not willing to put your name when "certifying" a body of code
I am not interested in looking at it.

Thanks.

-- 
Dmitry

  reply	other threads:[~2026-11-06 22:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 22:30 [PATCH v5 0/2] rust: input: add input/serio abstractions and port Gravis Stinger driver clicedvly768
2026-11-06 22:30 ` [PATCH v5 1/2] rust: input: add input device abstractions clicedvly768
2026-11-06 22:49   ` Dmitry Torokhov [this message]
2026-11-06 22:30 ` [PATCH v5 2/2] rust: serio: add serio bus abstractions and port Gravis Stinger driver clicedvly768
2026-11-06 22:44   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=au5ZLv09L2l3LwZP@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=harepro29@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).