From: Jani Nikula <jani.nikula@linux.intel.com>
To: Deepak R Varma <mh12gx2825@gmail.com>,
outreachy-kernel@googlegroups.com,
Zhenyu Wang <zhenyuw@linux.intel.com>,
Zhi Wang <zhi.a.wang@intel.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
intel-gvt-dev@lists.freedesktop.org,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Cc: mh12gx2825@gmail.com, melissa.srw@gmail.com, daniel.vetter@ffwll.ch
Subject: Re: [PATCH] drm/i915/gvt: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()
Date: Fri, 30 Oct 2020 11:52:42 +0200 [thread overview]
Message-ID: <87y2joghw5.fsf@intel.com> (raw)
In-Reply-To: <20201030032945.GA274850@my--box>
On Fri, 30 Oct 2020, Deepak R Varma <mh12gx2825@gmail.com> wrote:
> Using DEFINE_DEBUGFS_ATTRIBUTE macro with debugfs_create_file_unsafe()
> function in place of the debugfs_create_file() function will make the
> file operation struct "reset" aware of the file's lifetime. Additional
> details here: https://lists.archive.carbon60.com/linux/kernel/2369498
Please describe what the functional impact is in the commit message. I
don't understand what 'make the file operation struct "reset" aware of
the file's lifetime' means here.
For referencing LKML posts, please prefer https://lore.kernel.org/.
For referencing commits already in the kernel, please prefer the format
c64688081490 ("debugfs: add support for self-protecting attribute file
fops").
BR,
Jani.
>
> Issue reported by Coccinelle script:
> scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci
>
> Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
> ---
> Please Note: This is a Outreachy project task patch.
>
> drivers/gpu/drm/i915/gvt/debugfs.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gvt/debugfs.c b/drivers/gpu/drm/i915/gvt/debugfs.c
> index 62e6a14ad58e..18adfa2d5f5b 100644
> --- a/drivers/gpu/drm/i915/gvt/debugfs.c
> +++ b/drivers/gpu/drm/i915/gvt/debugfs.c
> @@ -147,9 +147,8 @@ vgpu_scan_nonprivbb_set(void *data, u64 val)
> return 0;
> }
>
> -DEFINE_SIMPLE_ATTRIBUTE(vgpu_scan_nonprivbb_fops,
> - vgpu_scan_nonprivbb_get, vgpu_scan_nonprivbb_set,
> - "0x%llx\n");
> +DEFINE_DEBUGFS_ATTRIBUTE(vgpu_scan_nonprivbb_fops, vgpu_scan_nonprivbb_get,
> + vgpu_scan_nonprivbb_set, "0x%llx\n");
>
> /**
> * intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
> @@ -165,8 +164,8 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)
> debugfs_create_bool("active", 0444, vgpu->debugfs, &vgpu->active);
> debugfs_create_file("mmio_diff", 0444, vgpu->debugfs, vgpu,
> &vgpu_mmio_diff_fops);
> - debugfs_create_file("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
> - &vgpu_scan_nonprivbb_fops);
> + debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
> + &vgpu_scan_nonprivbb_fops);
> }
>
> /**
--
Jani Nikula, Intel Open Source Graphics Center
prev parent reply other threads:[~2020-10-30 9:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-30 3:29 [PATCH] drm/i915/gvt: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe() Deepak R Varma
2020-10-30 9:52 ` Jani Nikula [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=87y2joghw5.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=airlied@linux.ie \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=melissa.srw@gmail.com \
--cc=mh12gx2825@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
--cc=rodrigo.vivi@intel.com \
--cc=zhenyuw@linux.intel.com \
--cc=zhi.a.wang@intel.com \
/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).