Re: [viro-vfs:work.alpha 5/8] arch/alpha/kernel/io.c:655:1: error: redefinition of 'scr_memcpyw'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 28, 2024 at 01:55:31PM -0800, Linus Torvalds wrote:
> On Sun, 28 Jan 2024 at 13:15, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
> >
> > The thing is, VT_BUF_HAVE_... are defined in asm/vga.h, so if you don't
> > have VGA_CONSOLE or MDA_CONSOLE you are going to get the default ones.
> > In case of scr_memcpyw() it's going to end up with memcpy(); on alpha
> > that does *not* match the native scr_memcpyw() instance.
> >
> > Since we have vga.h in mandatory-y, with asm-generic fallback being
> > reasonable enough...  Should that include of asm/vga.h be conditional
> > in the first place?
> 
> It should be conditional, because that's the only case you want to
> actually have that special scr_memsetw() etc.
> 
> I think the problem is that you added the vtbuf include to <asm/io.h>,
> which gets included from VGA_H early, before vga.h has even had time
> to tell people that it overrides those helper functions.

Nope.  It's arch/alpha/kernel/io.c growing an include of linux/vt_buffer.h
and blowing up on allnoconfig.  The reason for that include was the
"missing prototype" on scr_memcpyw() definition in there...

> I assume that moving the
> 
>     #define VT_BUF_HAVE_RW
>     #define VT_BUF_HAVE_MEMSETW
>     #define VT_BUF_HAVE_MEMCPYW
> 
> to above the
> 
>     #include <asm/io.h>
> 
> fixes the build?

No such thing...  I can add an explicit extern in io.c, but that's
really obnoxious ;-/

> That said, a good alternative might be to just stop using 'inline' for
> the default scr_memsetw() and scr_memcpyw() functions, make them real
> functions, and mark them __weak.
> 
> Then architectures can override them much more easily, and inlining
> them seems a bit pointless.
> 
> But I doubt it's even worth cleaning things up in this area.

Do we ever use that thing on iomem in non-VGA setups?




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux