lkml.org 
[lkml]   [2020]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Input: edt-ft5x06: Use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs fops
On Wed, May 06, 2020 at 08:36:22PM +0530, Aishwarya Ramakrishnan wrote:
> From: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com>
>
> On Tue, May 5, 2020 at 11:49 PM Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> > On Tue, May 05, 2020 at 09:03:24PM +0530, Aishwarya Ramakrishnan wrote:
> >> It is more clear to use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs file
> >> operation rather than DEFINE_SIMPLE_ATTRIBUTE.
>
> > No it is not, why do you think so?
>
> This change is suggested by Coccinelle software.
> Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

Not a good thing, I do not know why that was added :(

> > The two defines do different things, that is why we have 2 different
> > defines. You can not just replace one with the other without
> > understanding why one was used and not the other one.
>
> > Did you test this change to verify that everything still works
> > properly? Why is it needed to be changed at all?
>
> DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file()
> imposes some significant overhead as compared to
> DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe().

What kind of overhead? Is it required?

> But I missed to use debugfs_create_file_unsafe() function in the patch.

Yeah, don't use the unsafe stuff unless you know what is happening here
please.

greg k-h

\
 
 \ /
  Last update: 2020-05-06 17:23    [W:0.225 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site