mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Kees Cook <keescook@chromium.org>
Cc: Yangtao Li <tiny.windzz@gmail.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>, X86 ML <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86/mm/dump_pagetables: Change to use DEFINE_SHOW_ATTRIBUTE macro
Date: Wed, 28 Nov 2018 10:44:57 -0800	[thread overview]
Message-ID: <dd78fa9f-f27c-1579-1bc3-0b63acf54672@intel.com> (raw)
In-Reply-To: <CAGXu5jJuHQOi3C7_xH7Fo2H-=EmzKkwAPWmWPOUNb0WWMTLnJQ@mail.gmail.com>

On 11/27/18 2:50 PM, Kees Cook wrote:
> On Mon, Nov 19, 2018 at 9:06 AM, Dave Hansen <dave.hansen@intel.com> wrote:
>> 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.
> 
> Er, "ptdump_curusr" matches the generated name "ptdump_curusr_show",
> is that what you mean?

Ahh, I also missed some of the renames to make this OK, like:

> -static int ptdump_show_efi(struct seq_file *m, void *v)
> +static int ptdump_efi_show(struct seq_file *m, void *v)

I thought there was some macro magic going on that screwed the names up.

This looks fine to me.

Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>

  parent reply	other threads:[~2018-11-28 18:45 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
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 [this message]
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=dd78fa9f-f27c-1579-1bc3-0b63acf54672@intel.com \
    --to=dave.hansen@intel.com \
    --cc=bp@alien8.de \
    --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®