Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Hans Zhang" <18255117159@163.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: dwc: Use DEFINE_SHOW_ATTRIBUTE for ltssm_status debugfs
Date: Fri, 08 May 2026 20:51:37 +0000	[thread overview]
Message-ID: <20260508205138.61A4FC2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260508133432.1964491-1-18255117159@163.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message inaccurately claims 'No functional change intended', while the patch implicitly fixes a memory leak and module unload race condition.
--

commit 3ba9e0fae6d8b7784978dea48b58611a119ad5c9
Author: Hans Zhang <18255117159@163.com>

PCI: dwc: Use DEFINE_SHOW_ATTRIBUTE for ltssm_status debugfs

This commit replaces the custom open function and file operations for
the ltssm_status debugfs file with the DEFINE_SHOW_ATTRIBUTE macro to
reduce boilerplate.

> Replace the custom open function and file_operations with the
> standard DEFINE_SHOW_ATTRIBUTE macro to reduce boilerplate code.
> 
> No functional change intended.

Is the "No functional change intended" description accurate here?

The original code used single_open() but did not provide a .release
callback, which leaks the seq_file on close:

> -static int ltssm_status_open(struct inode *inode, struct file *file)
> -{
> -	return single_open(file, ltssm_status_show, inode->i_private);
> -}

[ ... ]

> -static const struct file_operations dwc_pcie_ltssm_status_ops = {
> -	.open = ltssm_status_open,
> -	.read = seq_read,
> -};
> +DEFINE_SHOW_ATTRIBUTE(ltssm_status);

By migrating to DEFINE_SHOW_ATTRIBUTE(), the new file operations
automatically include .release = single_release and .owner = THIS_MODULE.

Could the commit message be updated to reflect that this implicitly fixes
a seq_file memory leak and a module unload race condition?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260508133432.1964491-1-18255117159@163.com?part=1

      reply	other threads:[~2026-05-08 20:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08 13:34 [PATCH] PCI: dwc: Use DEFINE_SHOW_ATTRIBUTE for ltssm_status debugfs Hans Zhang
2026-05-08 20:51 ` sashiko-bot [this message]

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=20260508205138.61A4FC2BCB0@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=18255117159@163.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko@lists.linux.dev \
    /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