From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2B6A9EB64DA for ; Mon, 19 Jun 2023 09:12:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B13910E1C6; Mon, 19 Jun 2023 09:12:01 +0000 (UTC) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 22B0E10E1C6; Mon, 19 Jun 2023 09:11:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687165920; x=1718701920; h=message-id:date:mime-version:subject:from:to:cc: references:in-reply-to:content-transfer-encoding; bh=XlJtRLxJS+pnRJUHddiRBMiJzl1tgKQnykUH5eJThvE=; b=jT4kB5CTsOQNxX2o4BBJPn138noegG4fMrz6/t4BI63dO4lZ0lZzYUtZ fhK+ZkVl1MhDUmweMrijCYPf94qZMON4rmwyX3ZSLEy2U9Yfm53Q3R176 /Nqd6JmV5i32Qr+/Qk683ZCSLjg8/JTVbf8U53l5FUuzjNZtFWSkOsPHY vTVLzI1ljKZi9ldAT0nPHAmTVQOpvUt+MxETIcBjdIZHX+VB2dMRlPIA3 fMLuPFM/ZZi0xqZVde3H8Z3Zbh5HquR4u6DNXD6mdGQbZYS1VGzSq7M8c pYhDJwAZB8pozkwNPNQeC7SiCtjnw3HCXkF6oh8ko7inaQJJe6gsvw4s4 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10745"; a="423247771" X-IronPort-AV: E=Sophos;i="6.00,254,1681196400"; d="scan'208";a="423247771" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2023 02:11:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10745"; a="691030609" X-IronPort-AV: E=Sophos;i="6.00,254,1681196400"; d="scan'208";a="691030609" Received: from acarew-mobl.ger.corp.intel.com (HELO [10.213.214.207]) ([10.213.214.207]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2023 02:11:55 -0700 Message-ID: Date: Mon, 19 Jun 2023 10:11:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: en-US From: Tvrtko Ursulin To: Andi Shyti , Arnd Bergmann References: <20230616093158.3568480-1-arnd@kernel.org> Organization: Intel Corporation UK Plc In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Intel-gfx] [PATCH] drm/i915: make i915_drm_client_fdinfo() reference conditional again X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alan Previn , Arnd Bergmann , Matt Roper , Lucas De Marchi , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Rodrigo Vivi , David Airlie , intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 16/06/2023 12:17, Tvrtko Ursulin wrote: > > On 16/06/2023 11:16, Andi Shyti wrote: >> Hi Arnd, >> >> On Fri, Jun 16, 2023 at 11:31:47AM +0200, Arnd Bergmann wrote: >>> From: Arnd Bergmann >>> >>> The function is only defined if CONFIG_PROC_FS is enabled: >>> >>> ld.lld: error: undefined symbol: i915_drm_client_fdinfo >>>>>> referenced by i915_driver.c >>>>>> >>>>>> drivers/gpu/drm/i915/i915_driver.o:(i915_drm_driver) in archive >>>>>> vmlinux.a >>> >>> Use the PTR_IF() helper to make the reference NULL otherwise. >>> >>> Fixes: e894b724c316d ("drm/i915: Use the fdinfo helper") >>> Signed-off-by: Arnd Bergmann >>> --- >>>   drivers/gpu/drm/i915/i915_driver.c     | 2 +- >>>   drivers/gpu/drm/i915/i915_drm_client.h | 2 -- >>>   2 files changed, 1 insertion(+), 3 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/i915/i915_driver.c >>> b/drivers/gpu/drm/i915/i915_driver.c >>> index 75cbc43b326dd..0ad0c5885ec27 100644 >>> --- a/drivers/gpu/drm/i915/i915_driver.c >>> +++ b/drivers/gpu/drm/i915/i915_driver.c >>> @@ -1816,7 +1816,7 @@ static const struct drm_driver i915_drm_driver = { >>>       .open = i915_driver_open, >>>       .lastclose = i915_driver_lastclose, >>>       .postclose = i915_driver_postclose, >>> -    .show_fdinfo = i915_drm_client_fdinfo, >>> +    .show_fdinfo = PTR_IF(IS_ENABLED(CONFIG_PROC_FS), >>> i915_drm_client_fdinfo), >>>       .prime_handle_to_fd = drm_gem_prime_handle_to_fd, >>>       .prime_fd_to_handle = drm_gem_prime_fd_to_handle, >>> diff --git a/drivers/gpu/drm/i915/i915_drm_client.h >>> b/drivers/gpu/drm/i915/i915_drm_client.h >>> index 4c18b99e10a4e..67816c912bca1 100644 >>> --- a/drivers/gpu/drm/i915/i915_drm_client.h >>> +++ b/drivers/gpu/drm/i915/i915_drm_client.h >>> @@ -47,8 +47,6 @@ static inline void i915_drm_client_put(struct >>> i915_drm_client *client) >>>   struct i915_drm_client *i915_drm_client_alloc(void); >>> -#ifdef CONFIG_PROC_FS >>>   void i915_drm_client_fdinfo(struct drm_printer *p, struct drm_file >>> *file); >>> -#endif >> >> nice! This is becoming the new trend now. >> >> Reviewed-by: Andi Shyti > > Thanks for the fix and review! (And I got to learn about existence of > PTR_IF too.) > > Andi will you merge once green or should I? Pushed, thanks for the fixup and review! Regards, Tvrtko