It is more clear to use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs file operation rather than DEFINE_SIMPLE_ATTRIBUTE.
Found using coccinelle.
Signed-off-by: R Veera Kumar vkor@vkten.in --- Changes in v2: - Give correct explanation for patch - Adjust git commit tag and msg accordingly --- drivers/staging/android/ion/ion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 38b51eace4f9..dbe4018a6f83 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -554,8 +554,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) {
On Thu, Apr 09, 2020 at 10:43:18PM +0530, R Veera Kumar wrote:
It is more clear to use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs file operation rather than DEFINE_SIMPLE_ATTRIBUTE.
No, it is not "more clear", the two defines are not the same thing, they do different things. If they were just identical, we would not need them both :)
So please be very explicit as to _why_ you want to change this, and show how you have verified that changing this is the correct thing to do, and how you tested. Because the user-visible change can be quite different with this type of kernel change.
thanks,
greg k-h
linaro-mm-sig@lists.linaro.org