Re: [PATCH] media: dib0700: fix link error for dibx000_i2c_set_speed
From: Arnd Bergmann
Date: Fri Jun 28 2019 - 08:15:04 EST
On Wed, Apr 3, 2019 at 6:34 PM Sean Young <sean@xxxxxxxx> wrote:
>
> On Wed, Mar 13, 2019 at 10:16:53PM +0100, Arnd Bergmann wrote:
> > When CONFIG_DVB_DIB9000 is disabled, we can still compile code that
> > now fails to link against dibx000_i2c_set_speed:
> >
> > drivers/media/usb/dvb-usb/dib0700_devices.o: In function `dib01x0_pmu_update.constprop.7':
> > dib0700_devices.c:(.text.unlikely+0x1c9c): undefined reference to `dibx000_i2c_set_speed'
> >
> > The call sites are both through dib01x0_pmu_update(), which gets
> > passed an 'i2c' pointer from dib9000_get_i2c_master(), which has
> > returned NULL. Checking this pointer seems to be a good idea
> > anyway, and it avoids the link failure.
>
> So I reproduced the link failure with attached config, and your patch
> does not fix it.
I ran into the old problem I reported once more, and checked my
original patch, as well as your configuration file, which indeed shows
the same symptom.
Interestingly, the link error after my patch appears to be the result
of a compiler bug, as the function reference is from dead code that
should have been eliminated. Sending a replacement patch now.
Arnd