Bug 204541

Summary: Link of kernel fails due to multiple definitions of trackpoint_detect
Product: Drivers Reporter: Jeffrey E. Bedard (jefbed)
Component: Input DevicesAssignee: drivers_input-devices
Status: NEW ---    
Severity: normal CC: hui.wang
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 4.14.138 Subsystem:
Regression: No Bisected commit-id:
Attachments: build log

Description Jeffrey E. Bedard 2019-08-10 00:08:54 UTC
Created attachment 284305 [details]
build log

Linking fails with alps driver enabled, as follows:

drivers/input/mouse/alps.o: In function `trackpoint_detect':
alps.c:(.text+0x4ad0): multiple definition of `trackpoint_detect'
drivers/input/mouse/psmouse-base.o:psmouse-base.c:(.text+0x1480): first defined here

Enabling configuration option CONFIG_MOUSE_PS2_TRACKPOINT fixes the build.

Configuration option CONFIG_MOUSE_PS2_ALPS should be changed to depend upon CONFIG_MOUSE_PS2_TRACKPOINT.
Comment 1 Hui Wang 2019-08-19 12:40:38 UTC
This bug is fixed by:

commit 49e6979e7e92cf496105b5636f1df0ac17c159c0
Author: YueHaibing <yuehaibing@huawei.com>
Date:   Tue Jul 16 20:17:20 2019 +0200

    Input: psmouse - fix build error of multiple definition
   
    trackpoint_detect() should be static inline while
    CONFIG_MOUSE_PS2_TRACKPOINT is not set, otherwise, we build fails:
   
    drivers/input/mouse/alps.o: In function `trackpoint_detect':
    alps.c:(.text+0x8e00): multiple definition of `trackpoint_detect'
    drivers/input/mouse/psmouse-base.o:psmouse-base.c:(.text+0x1b50): first defined here
   
    Reported-by: Hulk Robot <hulkci@huawei.com>
    Fixes: 55e3d9224b60 ("Input: psmouse - allow disabing certain protocol extensions")
    Signed-off-by: YueHaibing <yuehaibing@huawei.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

And it is in the mainline kernel from v5.3-rc1.