rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] rust: add cdev for rust bindings helper
@ 2025-03-04  4:04 Sidong Yang
  2025-03-04  5:42 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Sidong Yang @ 2025-03-04  4:04 UTC (permalink / raw)
  To: rust-for-linux; +Cc: Sidong Yang, linux-kernel

This patch adds cdev rust bindings.

Signed-off-by: Sidong Yang <sidong.yang@furiosa.ai>
---
 rust/bindings/bindings_helper.h | 1 +
 rust/helpers/cdev.c             | 3 +++
 rust/helpers/helpers.c          | 1 +
 3 files changed, 5 insertions(+)
 create mode 100644 rust/helpers/cdev.c

diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
index f46cf3bb7069..07145905bc10 100644
--- a/rust/bindings/bindings_helper.h
+++ b/rust/bindings/bindings_helper.h
@@ -10,6 +10,7 @@
 #include <linux/blk-mq.h>
 #include <linux/blk_types.h>
 #include <linux/blkdev.h>
+#include <linux/cdev.h>
 #include <linux/cred.h>
 #include <linux/device/faux.h>
 #include <linux/errname.h>
diff --git a/rust/helpers/cdev.c b/rust/helpers/cdev.c
new file mode 100644
index 000000000000..929aa5359a47
--- /dev/null
+++ b/rust/helpers/cdev.c
@@ -0,0 +1,3 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/cdev.h>
diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c
index 0640b7e115be..6aa69761409e 100644
--- a/rust/helpers/helpers.c
+++ b/rust/helpers/helpers.c
@@ -11,6 +11,7 @@
 #include "bug.c"
 #include "build_assert.c"
 #include "build_bug.c"
+#include "cdev.c"
 #include "cred.c"
 #include "device.c"
 #include "err.c"
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH] rust: add cdev for rust bindings helper
  2025-03-04  4:04 [RFC PATCH] rust: add cdev for rust bindings helper Sidong Yang
@ 2025-03-04  5:42 ` Greg KH
  2025-03-04 10:09   ` Miguel Ojeda
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2025-03-04  5:42 UTC (permalink / raw)
  To: Sidong Yang; +Cc: rust-for-linux, linux-kernel

On Tue, Mar 04, 2025 at 01:04:49PM +0900, Sidong Yang wrote:
> This patch adds cdev rust bindings.

Ok, but why?

And why not cc: the cdev maintainer?  :)

You'll need a much better changelog here, as well as a reason why you
need this and can't just use the miscdev binding instead.  Have you
tried that one out?

> Signed-off-by: Sidong Yang <sidong.yang@furiosa.ai>
> ---
>  rust/bindings/bindings_helper.h | 1 +
>  rust/helpers/cdev.c             | 3 +++
>  rust/helpers/helpers.c          | 1 +
>  3 files changed, 5 insertions(+)
>  create mode 100644 rust/helpers/cdev.c
> 
> diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
> index f46cf3bb7069..07145905bc10 100644
> --- a/rust/bindings/bindings_helper.h
> +++ b/rust/bindings/bindings_helper.h
> @@ -10,6 +10,7 @@
>  #include <linux/blk-mq.h>
>  #include <linux/blk_types.h>
>  #include <linux/blkdev.h>
> +#include <linux/cdev.h>
>  #include <linux/cred.h>
>  #include <linux/device/faux.h>
>  #include <linux/errname.h>
> diff --git a/rust/helpers/cdev.c b/rust/helpers/cdev.c
> new file mode 100644
> index 000000000000..929aa5359a47
> --- /dev/null
> +++ b/rust/helpers/cdev.c
> @@ -0,0 +1,3 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +#include <linux/cdev.h>
> diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c
> index 0640b7e115be..6aa69761409e 100644
> --- a/rust/helpers/helpers.c
> +++ b/rust/helpers/helpers.c
> @@ -11,6 +11,7 @@
>  #include "bug.c"
>  #include "build_assert.c"
>  #include "build_bug.c"
> +#include "cdev.c"
>  #include "cred.c"
>  #include "device.c"
>  #include "err.c"
> -- 
> 2.34.1
> 

I think you're missing the actual bindings here, right?

confused,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH] rust: add cdev for rust bindings helper
  2025-03-04  5:42 ` Greg KH
@ 2025-03-04 10:09   ` Miguel Ojeda
  0 siblings, 0 replies; 3+ messages in thread
From: Miguel Ojeda @ 2025-03-04 10:09 UTC (permalink / raw)
  To: Greg KH; +Cc: Sidong Yang, rust-for-linux, linux-kernel

On Tue, Mar 4, 2025 at 6:42 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> I think you're missing the actual bindings here, right?
>
> confused,

I think this is:

    https://rust-for-linux.zulipchat.com/#narrow/channel/291565-Help/topic/trying.20to.20implement.20a.20chrdev.20in.20rust/near/503177362

And, yeah, we don't add headers that have no users, and we don't want
to promote avoiding to write abstractions either.

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-04 10:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-04  4:04 [RFC PATCH] rust: add cdev for rust bindings helper Sidong Yang
2025-03-04  5:42 ` Greg KH
2025-03-04 10:09   ` Miguel Ojeda

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).