[lkml]   [2018]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] x86/mm/dump_pagetables: Change to use DEFINE_SHOW_ATTRIBUTE macro
On 11/19/18 7:43 AM, Yangtao Li wrote:
> -static const struct file_operations ptdump_curusr_fops = {
> - .owner = THIS_MODULE,
> - .open = ptdump_open_curusr,
> - .read = seq_read,
> - .llseek = seq_lseek,
> - .release = single_release,
> -};
> +DEFINE_SHOW_ATTRIBUTE(ptdump_curusr);

FWIW, I rather dislike this conversion and the DEFINE_SHOW_ATTRIBUTE()
approach in general. It makes it basically impossible to go from
ptdump_curusr to ptdump_open_curusr without opening up the macro and
reverse-engineering it.

My test is that for these macros to be sane, I need to be able to find
"ptdump_open_curusr" by grepping for "ptdump_curusr". This fails the test.

I don't think saving a few lines of code is worth the obfuscation.

 \ /
  Last update: 2018-11-19 18:09    [W:0.104 / U:9.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site