Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1674205 > unrolled thread
| Started by | Tommy Nguyen <remyabel@gmail.com> |
|---|---|
| First post | 2017-06-25 14:30 +0200 |
| Last post | 2017-06-25 15:00 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] staging: android: ion: Use DEFINE_DEBUGFS_ATTRIBUTE Tommy Nguyen <remyabel@gmail.com> - 2017-06-25 14:30 +0200
Re: [PATCH] staging: android: ion: Use DEFINE_DEBUGFS_ATTRIBUTE Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-25 15:00 +0200
| From | Tommy Nguyen <remyabel@gmail.com> |
|---|---|
| Date | 2017-06-25 14:30 +0200 |
| Subject | [PATCH] staging: android: ion: Use DEFINE_DEBUGFS_ATTRIBUTE |
| Message-ID | <tWePU-52w-5@gated-at.bofh.it> |
Running coccicheck indicates that DEFINE_DEBUGFS_ATTRIBUTE
and debugfs_create_file_unsafe should be used instead.
Signed-off-by: Tommy Nguyen <remyabel@gmail.com>
---
drivers/staging/android/ion/ion.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index 03d3a4f..8f96b38 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -544,8 +544,8 @@ static int debug_shrink_get(void *data, u64 *val)
return 0;
}
-DEFINE_SIMPLE_ATTRIBUTE(debug_shrink_fops, debug_shrink_get,
- debug_shrink_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(debug_shrink_fops, debug_shrink_get,
+ debug_shrink_set, "%llu\n");
void ion_device_add_heap(struct ion_heap *heap)
{
@@ -579,7 +579,7 @@ void ion_device_add_heap(struct ion_heap *heap)
char debug_name[64];
snprintf(debug_name, 64, "%s_shrink", heap->name);
- debug_file = debugfs_create_file(
+ debug_file = debugfs_create_file_unsafe(
debug_name, 0644, dev->debug_root, heap,
&debug_shrink_fops);
if (!debug_file) {
--
2.9.4
[toc] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-06-25 15:00 +0200 |
| Message-ID | <tWfiW-5cl-13@gated-at.bofh.it> |
| In reply to | #1674205 |
On Sun, Jun 25, 2017 at 08:22:06AM -0400, Tommy Nguyen wrote: > Running coccicheck indicates that DEFINE_DEBUGFS_ATTRIBUTE > and debugfs_create_file_unsafe should be used instead. Why use the _unsafe version? Are you sure it will work properly? What benifit does it offer? > > Signed-off-by: Tommy Nguyen <remyabel@gmail.com> > --- > drivers/staging/android/ion/ion.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c > index 03d3a4f..8f96b38 100644 > --- a/drivers/staging/android/ion/ion.c > +++ b/drivers/staging/android/ion/ion.c > @@ -544,8 +544,8 @@ static int debug_shrink_get(void *data, u64 *val) > return 0; > } > > -DEFINE_SIMPLE_ATTRIBUTE(debug_shrink_fops, debug_shrink_get, > - debug_shrink_set, "%llu\n"); > +DEFINE_DEBUGFS_ATTRIBUTE(debug_shrink_fops, debug_shrink_get, > + debug_shrink_set, "%llu\n"); Are you sure this works? thanks, greg k-h
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web