Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752678AbdGYPxq (ORCPT ); Tue, 25 Jul 2017 11:53:46 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:38668 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753107AbdGYPxn (ORCPT ); Tue, 25 Jul 2017 11:53:43 -0400 Date: Tue, 25 Jul 2017 17:53:37 +0200 From: Daniel Vetter To: Arnd Bergmann Cc: Xinliang Liu , Rongrong Zou , David Airlie , Chen Feng , Russell King , Jyri Sarha , linux-kernel@vger.kernel.org, Xinwei Kong , dri-devel@lists.freedesktop.org, Daniel Vetter , Thierry Reding , Gabriel Krisman Bertazi Subject: Re: [PATCH] drm/hisilicon: fix build error without fbdev emulation Message-ID: <20170725155337.4ersxxu3nru7jy7q@phenom.ffwll.local> Mail-Followup-To: Arnd Bergmann , Xinliang Liu , Rongrong Zou , David Airlie , Chen Feng , Russell King , Jyri Sarha , linux-kernel@vger.kernel.org, Xinwei Kong , dri-devel@lists.freedesktop.org, Thierry Reding , Gabriel Krisman Bertazi References: <20170725153403.121302-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170725153403.121302-1-arnd@arndb.de> X-Operating-System: Linux phenom 4.11.0-2-amd64 User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2342 Lines: 70 On Tue, Jul 25, 2017 at 05:33:25PM +0200, Arnd Bergmann 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) > > Since the code is moved into the main probe function now, this > adds another #ifdef. > > Fixes: b4dd9f1ffaba ("drm/hisilicon: Remove custom FB helper deferred setup") > Signed-off-by: Arnd Bergmann Thanks for catching this. > --- > drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c > index 1178341c3858..d48102d1a7a4 100644 > --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c > +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c > @@ -121,6 +121,7 @@ static int kirin_drm_kms_init(struct drm_device *dev) > /* init kms poll for handling hpd */ > drm_kms_helper_poll_init(dev); > > +#ifdef CONFIG_DRM_FBDEV_EMULATION > priv->fbdev = drm_fbdev_cma_init(dev, 32, > dev->mode_config.num_connector); > if (IS_ERR(priv->fbdev)) { > @@ -128,11 +129,13 @@ static int kirin_drm_kms_init(struct drm_device *dev) > ret = PTR_ERR(priv->fbdev); > goto err_cleanup_poll; > } > - > +#endif Could we instead stop compling out priv->fbdev? There's nothing driver-specific here, so teh #ifdef are kinda annoying ... And saving that one pointer in a really huge structure is somewhat silly. > return 0; > > +#ifdef CONFIG_DRM_FBDEV_EMULATION > err_cleanup_poll: > drm_kms_helper_poll_fini(dev); poll helpers aren't fbdev specific. Why do we need this? Is this just to shut up gcc? Thanks, Daniel > +#endif > err_unbind_all: > component_unbind_all(dev->dev, dev); > err_dc_cleanup: > -- > 2.9.0 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch