[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2b91abe5-88bd-2941-d561-a8b0ad40f62b@intel.com>
Date: Thu, 17 Mar 2022 13:23:12 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>
Cc: mingo@...hat.com, bp@...en8.de, luto@...nel.org,
peterz@...radead.org, sathyanarayanan.kuppuswamy@...ux.intel.com,
aarcange@...hat.com, ak@...ux.intel.com, dan.j.williams@...el.com,
david@...hat.com, hpa@...or.com, jgross@...e.com,
jmattson@...gle.com, joro@...tes.org, jpoimboe@...hat.com,
knsathya@...nel.org, pbonzini@...hat.com, sdeep@...are.com,
seanjc@...gle.com, tony.luck@...el.com, vkuznets@...hat.com,
wanpengli@...cent.com, thomas.lendacky@....com,
brijesh.singh@....com, x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCHv6 15/30] x86/boot: Port I/O: allow to hook up alternative
helpers
On 3/17/22 13:20, Dave Hansen wrote:
> You keep the preprocessor away from things like
>
> foo.inb = bar;
>
> with:
>
> #define inb(x) pio_ops.inb(x)
... and I spotted my nonsense just as I hit send.
You could do that ^^. But you'd need to rename the 'inb' op like:
struct port_io_ops {
u8 (*f_inb)(u16 port);
...
};
so that you do:
#define inb(x) pio_ops.f_inb(x)
But, remember when I said I hate playing #define tricks? ;) This is one
reason why.
Powered by blists - more mailing lists