mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Yangtao Li <tiny.windzz@gmail.com>,
	keescook@chromium.org, dave.hansen@linux.intel.com,
	luto@kernel.org, peterz@infradead.org, tglx@linutronix.de,
	mingo@redhat.com, bp@alien8.de, hpa@zytor.com
Cc: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/mm/dump_pagetables: Change to use DEFINE_SHOW_ATTRIBUTE macro
Date: Mon, 19 Nov 2018 09:06:15 -0800	[thread overview]
Message-ID: <c9c572ed-05a1-cec9-97e9-2b66cb58afcc@intel.com> (raw)
In-Reply-To: <20181119154334.18265-1-tiny.windzz@gmail.com>

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.

  reply	other threads:[~2018-11-19 17:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19 15:43 Yangtao Li
2018-11-19 17:06 ` Dave Hansen [this message]
2018-11-20  0:49   ` Frank Lee
2018-11-20  0:50     ` Frank Lee
2018-11-27 22:50   ` Kees Cook
2018-11-28  0:57     ` Frank Lee
2018-11-28 18:44     ` Dave Hansen
2018-11-29 21:28       ` Kees Cook
2018-12-18 12:09 ` [tip:x86/mm] x86/mm/dump_pagetables: Use DEFINE_SHOW_ATTRIBUTE() tip-bot for Yangtao Li

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=c9c572ed-05a1-cec9-97e9-2b66cb58afcc@intel.com \
    --to=dave.hansen@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tiny.windzz@gmail.com \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®