Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751789AbdGYSEa (ORCPT ); Tue, 25 Jul 2017 14:04:30 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:36762 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751655AbdGYSE2 (ORCPT ); Tue, 25 Jul 2017 14:04:28 -0400 MIME-Version: 1.0 In-Reply-To: <20170725155337.4ersxxu3nru7jy7q@phenom.ffwll.local> References: <20170725153403.121302-1-arnd@arndb.de> <20170725155337.4ersxxu3nru7jy7q@phenom.ffwll.local> From: Arnd Bergmann Date: Tue, 25 Jul 2017 20:04:27 +0200 X-Google-Sender-Auth: qzO193twZIQ5zwJj-BhlgWR11_I Message-ID: Subject: Re: [PATCH] drm/hisilicon: fix build error without fbdev emulation To: Arnd Bergmann , Xinliang Liu , Rongrong Zou , David Airlie , Chen Feng , Russell King , Jyri Sarha , Linux Kernel Mailing List , Xinwei Kong , dri-devel , Thierry Reding , Gabriel Krisman Bertazi Cc: Daniel Vetter Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1930 Lines: 50 On Tue, Jul 25, 2017 at 5:53 PM, Daniel Vetter wrote: > On Tue, Jul 25, 2017 at 05:33:25PM +0200, Arnd Bergmann wrote: >> 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 ... Yes, I guess that would be better, I just didn't want to do too much of a rework. If we remove the #ifdef here, we should replace all instances in that driver. I'll send a patch to do that and let you pick which one you apply. > And saving that one pointer in a really huge structure is somewhat silly. It looks like it's the only member in that structure, but that doesn't make a big difference either, since there is only one instance in the system. >> +#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? Yes, gcc warns about the unused label here otherwise. Arnd