Re: [PATCH v2] drm/hisilicon: fix build error without fbdev emulation

From: Daniel Vetter
Date: Wed Jul 26 2017 - 06:47:21 EST


On Wed, Jul 26, 2017 at 08:58:16AM +0200, Arnd Bergmann wrote:
> On Wed, Jul 26, 2017 at 7:55 AM, Daniel Vetter <daniel.vetter@xxxxxxxx> wrote:
> > On Tue, Jul 25, 2017 at 8:05 PM, Arnd Bergmann <arnd@xxxxxxxx> wrote:
> >> We cannot reference priv->fbdev outside of the #ifdef:
> >>
> >> drivers/net/virtio_net.c:1881:12: error: 'virtnet_restore_up' defined but not used [-Werror=unused-function]
> >> static int virtnet_restore_up(struct virtio_device *vdev)
> >> drivers/net/virtio_net.c:1859:13: error: 'virtnet_freeze_down' defined but not used [-Werror=unused-function]
> >> static void virtnet_freeze_down(struct virtio_device *vdev)
> >>
> >> As the #ifdef is a bit annoying here, this removes it entirely
> >> and uses an IS_ENABLED() check in it place where needed.
> >>
> >> Fixes: b4dd9f1ffaba ("drm/hisilicon: Remove custom FB helper deferred setup")
> >> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> >
> > I guess I wasn't clear enough, but you don't even need the IS_ENABLED.
> > The cma_fini/init functions themselves don't get no-opped out (I guess
> > we could fix that), but the underlying fb helper functions they call
> > do, so this is all perfectly fine to call unconditionally. And that's
> > what all other drivers do. Should I edit while applying, or do you
> > want to respin?
>
> Please just edit as you like then, I think that's quicker.
>
> The version I sent was meant to have smaller object code as well, and
> I didn't think we could rely on drm_fb_cma_helper.c being built without
> CONFIG_DRM_FBDEV_EMULATION, but I see now that they are
> independent as you say, so making them unconditional indeed gives
> the simplest code.

Done, thanks.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch