public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Signed-off-by: Biancaa Ramesh <biancaa2210329@ssn.edu.in>
@ 2025-10-22  4:31 Biancaa Ramesh
  2025-10-22 10:07 ` Jani Nikula
  2025-10-22 11:14 ` [PATCH v2] Signed-off-by: Biancaa Ramesh … Markus Elfring
  0 siblings, 2 replies; 3+ messages in thread
From: Biancaa Ramesh @ 2025-10-22  4:31 UTC (permalink / raw)
  To: sumit.semwal
  Cc: christian.koenig, linux-media, dri-devel, linaro-mm-sig,
	linux-kernel, lkp, Biancaa Ramesh

dma-buf: improve dma_buf_show_fdinfo output

Improve the readability of /proc/<pid>/fdinfo output for DMA-BUF by
including file flags and ensuring consistent format specifiers for size
and other fields.

This patch also fixes incorrect format specifiers and removes references
to obsolete struct members (num_attachments and num_mappings) that no
longer exist in the DMA-BUF framework.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202510220802.svbgdYsJ-lkp@intel.com/
---
 drivers/dma-buf/dma-buf.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index 1c0035601c4f..4541f8ec5d62 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -571,24 +571,22 @@ static long dma_buf_ioctl(struct file *file,
 	}
 }
 
-static void dma_buf_show_fdinfo(struct seq_file *s, struct file *f)
+static void dma_buf_show_fdinfo(struct seq_file *s, struct file *file)
 {
-    struct dma_buf *dmabuf = f->private_data;
+	struct dma_buf *dmabuf;
 
-    if (!dmabuf)
-        return;
+	dmabuf = file->private_data;
+	if (!dmabuf)
+		return;
 
-    seq_printf(s, "flags:\t%lu\n", f->f_flags);
-    seq_printf(s, "size:\t%llu\n", dmabuf->size);
-    seq_printf(s, "count:\t%ld\n", file_count(dmabuf->file) - 1);
-    seq_printf(s, "attachments:\t%d\n", atomic_read(&dmabuf->num_attachments));
-    seq_printf(s, "mappings:\t%d\n", atomic_read(&dmabuf->num_mappings));
-    seq_printf(s, "exp_name:\t%s\n", dmabuf->exp_name ? dmabuf->exp_name : "N/A");
+	seq_printf(s, "size:\t%zu\n", dmabuf->size);
+	seq_printf(s, "count:\t%ld\n", file_count(dmabuf->file) - 1);
+	seq_printf(s, "exp_name:\t%s\n", dmabuf->exp_name ? dmabuf->exp_name : "N/A");
 
-    spin_lock(&dmabuf->name_lock);
-    if (dmabuf->name)
-        seq_printf(s, "name:\t%s\n", dmabuf->name);
-    spin_unlock(&dmabuf->name_lock);
+	spin_lock(&dmabuf->name_lock);
+	if (dmabuf->name)
+		seq_printf(s, "name:\t%s\n", dmabuf->name);
+	spin_unlock(&dmabuf->name_lock);
 }
 
 
-- 
2.43.0


-- 
::DISCLAIMER::

---------------------------------------------------------------------
The 
contents of this e-mail and any attachment(s) are confidential and
intended 
for the named recipient(s) only. Views or opinions, if any,
presented in 
this email are solely those of the author and may not
necessarily reflect 
the views or opinions of SSN Institutions (SSN) or its
affiliates. Any form 
of reproduction, dissemination, copying, disclosure,
modification, 
distribution and / or publication of this message without the
prior written 
consent of authorized representative of SSN is strictly
prohibited. If you 
have received this email in error please delete it and
notify the sender 
immediately.
---------------------------------------------------------------------
Header of this mail should have a valid DKIM signature for the domain 
ssn.edu.in <http://www.ssn.edu.in/>

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

* Re: [PATCH v2] Signed-off-by: Biancaa Ramesh <biancaa2210329@ssn.edu.in>
  2025-10-22  4:31 [PATCH v2] Signed-off-by: Biancaa Ramesh <biancaa2210329@ssn.edu.in> Biancaa Ramesh
@ 2025-10-22 10:07 ` Jani Nikula
  2025-10-22 11:14 ` [PATCH v2] Signed-off-by: Biancaa Ramesh … Markus Elfring
  1 sibling, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2025-10-22 10:07 UTC (permalink / raw)
  To: Biancaa Ramesh, sumit.semwal
  Cc: christian.koenig, linux-media, dri-devel, linaro-mm-sig,
	linux-kernel, lkp, Biancaa Ramesh

On Wed, 22 Oct 2025, Biancaa Ramesh <biancaa2210329@ssn.edu.in> wrote:
> -- 
> ::DISCLAIMER::
> 
> ---------------------------------------------------------------------
> The 
> contents of this e-mail and any attachment(s) are confidential and
> intended 
> for the named recipient(s) only. Views or opinions, if any,
> presented in 
> this email are solely those of the author and may not
> necessarily reflect 
> the views or opinions of SSN Institutions (SSN) or its
> affiliates. Any form 
> of reproduction, dissemination, copying, disclosure,
> modification, 
> distribution and / or publication of this message without the
> prior written 
> consent of authorized representative of SSN is strictly
> prohibited. If you 
> have received this email in error please delete it and
> notify the sender 
> immediately.

There are some obvious issues in the patch itself, but please do figure
out how to send patches and generally list email without disclaimers
like this first. Or use the b4 web submission endpoint [1].

BR,
Jani.


[1] https://b4.docs.kernel.org/en/latest/contributor/send.html

-- 
Jani Nikula, Intel

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

* Re: [PATCH v2] Signed-off-by: Biancaa Ramesh …
  2025-10-22  4:31 [PATCH v2] Signed-off-by: Biancaa Ramesh <biancaa2210329@ssn.edu.in> Biancaa Ramesh
  2025-10-22 10:07 ` Jani Nikula
@ 2025-10-22 11:14 ` Markus Elfring
  1 sibling, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2025-10-22 11:14 UTC (permalink / raw)
  To: Biancaa Ramesh, linux-media, dri-devel, Sumit Semwal
  Cc: linaro-mm-sig, linux-kernel, lkp, Christian König

> dma-buf: improve dma_buf_show_fdinfo output
> This patch also fixes incorrect …

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.18-rc2#n94


> Closes: https://lore.kernel.org/oe-kbuild-all/202510220802.svbgdYsJ-lkp@intel.com/

Not yet.

Please use a more appropriate patch subject for the proposed adjustment
of the function “dma_buf_show_fdinfo”.
https://elixir.bootlin.com/linux/v6.18-rc2/source/drivers/dma-buf/dma-buf.c#L570-L582
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.18-rc2#n396


> ---
>  drivers/dma-buf/dma-buf.c | 26 ++++++++++++--------------
…

Some contributors would appreciate patch version descriptions.
https://lore.kernel.org/all/?q=%22This+looks+like+a+new+version+of+a+previously+submitted+patch%22
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.18-rc2#n310> +++ b/drivers/dma-buf/dma-buf.c
> @@ -571,24 +571,22 @@ static long dma_buf_ioctl(struct file *file,
>  	}
>  }
>  
> -static void dma_buf_show_fdinfo(struct seq_file *s, struct file *f)
> +static void dma_buf_show_fdinfo(struct seq_file *s, struct file *file)
>  {
…
…
> -    seq_printf(s, "flags:\t%lu\n", f->f_flags);
> -    seq_printf(s, "size:\t%llu\n", dmabuf->size);

* Why does such a diff representation contain space characters instead of tab characters?

* Did you refer to a source code variant before the commit bcc071110aeacd28a87525a2442dd96eab145a3c
  ("dma-buf: add show_fdinfo handler") from 2019-06-14?


…
> -- 
> ::DISCLAIMER::
> The 
> contents of this e-mail and any attachment(s) are confidential and
…

Please avoid such unwanted information for communication by the means of public mailing lists.
https://subspace.kernel.org/etiquette.html#do-not-include-confidentiality-disclaimers

Regards,
Markus

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

end of thread, other threads:[~2025-10-22 11:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-22  4:31 [PATCH v2] Signed-off-by: Biancaa Ramesh <biancaa2210329@ssn.edu.in> Biancaa Ramesh
2025-10-22 10:07 ` Jani Nikula
2025-10-22 11:14 ` [PATCH v2] Signed-off-by: Biancaa Ramesh … Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox