Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3118431pxb; Mon, 9 Nov 2020 03:08:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxyihUqg/CCRCRm73hOUYtZRrkrJ5Q+H38Lp+9vb3BRqS1OXTYEXSNf4khWGTrzwagWRnB X-Received: by 2002:a17:906:40cb:: with SMTP id a11mr15231795ejk.217.1604920089763; Mon, 09 Nov 2020 03:08:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604920089; cv=none; d=google.com; s=arc-20160816; b=MnG3czRsGv8dUo/N60PfgUEUmKmRCtT41ABSCP9P2iyJT2FxTGPgDg+3f0Uy3JK8Rw endXE69tmTzVqBBcck2pKMnLxJgS2qXI/LNQO5uyWPqObfY0te51kavJSlo6SW4bCIX5 PejgsqnAFKm22yQMFWp1d56X/qhyiu8M85sE6K4+v0UBCf/yyp7WKEr0TaV7sD2WVhB7 u/+8BeE18FUfDf1+a2aa5IfF4/oiKuvHkpQOyc7CDqpc2W8Nj9MlnjFeWmOCj7H956Lv r0d1hYSg4Sdg8cttFQ8TSI9vWn4APKijsKnkSM5kmlMCG3Tt1CL0BbextahmHIbknwTS EFTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/TTLN5u5ntD12Tf50xVKp1qDLZNw1PZvWBuHFthUL88=; b=D5t7eZwO/3o3jaZiz+4sOsUYU/2TtrTFAk1aAqEkaUDt5TJwLYsA2S4C6+u0SdPv+i rqK+VTbRN8jU3gGbkSEOIR+x6ds/gw2Vhg7BIenwx+mEHL2yUv+4ZfOLkIh1c9Ea186k FlyQCfcq2/m2GTOiv2E6CRQJUxaihTYBhxCrmMnb1EV4eGGRtpHoAUeXuus5HmRQeTra FfIuI4Dvh/VsqzVknwWI7gtFADka0G88Fz3tLdf2b87OlZAnj1shGM5idl8YnR2i5jdf hFEQBEXPTRjEkP+ocDgIPGR8+1aQmOyoDJyP4ODQNY0XMtmg0VJRJWayv2JU2mWnBLCX kmcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TKPmIbHz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k20si6065562ejj.93.2020.11.09.03.07.45; Mon, 09 Nov 2020 03:08:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TKPmIbHz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727774AbgKILGN (ORCPT + 99 others); Mon, 9 Nov 2020 06:06:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727303AbgKILGM (ORCPT ); Mon, 9 Nov 2020 06:06:12 -0500 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79026C0613CF for ; Mon, 9 Nov 2020 03:06:12 -0800 (PST) Received: by mail-wm1-x342.google.com with SMTP id d142so7566678wmd.4 for ; Mon, 09 Nov 2020 03:06:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=/TTLN5u5ntD12Tf50xVKp1qDLZNw1PZvWBuHFthUL88=; b=TKPmIbHz/sJNchjhXki9tBdowYhfzhopEljHcLDYcu2bt52SrzWKjteWCU58KX353a /P/wKKssgcalNm6WMoiInsUU0tYzqmWTdvvP1x2IC4lMkbZRYpg+8gP5TNFHScYSbQbf zNFvHFuDW2gZ2fs7lZw50G9oLfMph4J7tRayNoOEWmnQba2vledcJcf/7z8jURCZlZ7a q1nHIvFPWzIZXH/8EdX8up20/kjt7+d1ENZ+xWOQBxc7IIpx9GwZzr2Y1ubWdpjsgzd2 Ul6YISZB4Gbk64r1IG9P7c6sH25ulfmr2nRzCJeRtHvEfs63vwtVjnue1xJMXbGaFrRS Tfug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=/TTLN5u5ntD12Tf50xVKp1qDLZNw1PZvWBuHFthUL88=; b=pixSzdJI80RRZMjjeosXr2pBv/ew+itbgt4J3/TOj4+EVd6erLuSDjxUspzx7NsSkO XHRyPqOdOibzpaWDYd3RcaP7j6g7QnNgpgU4GviStGA0+/BmqLMkpDEqwPy3y+XmvJZH tCAhChj+cveCuwgjI7VfsUhM1+T7v/InXgrmIXEai8Qh47jjl8Cr9Kz1RBprO3HwamJD 4ifrhqyKq2JS+s58uiKX7y+Lq/WKMvRHIo6yU98xFljH8KpuUVhqZTAecYkkEwIfOWt8 aPjTgiEx9FvkJKZXtsU/RfC9tadRqZA36S+h2wg1S+ym7zXkvt8gUrIWcND/iy7tgLE/ ZIJw== X-Gm-Message-State: AOAM533YPZxyxHViEY9jiKqW6BpJhORoF8DhEFspOaexJs7fct2Dc6Wi lAPskjPpIL/3JKXsMCAjtZc63zb6jmmevEoR X-Received: by 2002:a1c:67d5:: with SMTP id b204mr14273334wmc.92.1604919971242; Mon, 09 Nov 2020 03:06:11 -0800 (PST) Received: from dell ([91.110.221.180]) by smtp.gmail.com with ESMTPSA id h62sm13193538wrh.82.2020.11.09.03.06.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 03:06:10 -0800 (PST) Date: Mon, 9 Nov 2020 11:06:03 +0000 From: Lee Jones To: Sam Ravnborg Cc: David Airlie , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, Christian =?iso-8859-1?Q?K=F6nig?= , linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org, Alex Deucher , linux-media@vger.kernel.org Subject: Re: [PATCH 10/19] drm/radeon/radeon: Move prototype into shared header Message-ID: <20201109110603.GV2063125@dell> References: <20201106214949.2042120-1-lee.jones@linaro.org> <20201106214949.2042120-11-lee.jones@linaro.org> <20201107142651.GA1014611@ravnborg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201107142651.GA1014611@ravnborg.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 07 Nov 2020, Sam Ravnborg wrote: > Hi Lee, > > On Fri, Nov 06, 2020 at 09:49:40PM +0000, Lee Jones wrote: > > Unfortunately, a suitable one didn't already exist. > > > > Fixes the following W=1 kernel build warning(s): > > > > drivers/gpu/drm/radeon/radeon_device.c:637:6: warning: no previous prototype for ‘radeon_device_is_virtual’ [-Wmissing-prototypes] > > 637 | bool radeon_device_is_virtual(void) > > | ^~~~~~~~~~~~~~~~~~~~~~~~ > > > > Cc: Alex Deucher > > Cc: "Christian König" > > Cc: David Airlie > > Cc: Daniel Vetter > > Cc: Sumit Semwal > > Cc: amd-gfx@lists.freedesktop.org > > Cc: dri-devel@lists.freedesktop.org > > Cc: linux-media@vger.kernel.org > > Cc: linaro-mm-sig@lists.linaro.org > > Signed-off-by: Lee Jones > > --- > > drivers/gpu/drm/radeon/radeon_device.c | 1 + > > drivers/gpu/drm/radeon/radeon_device.h | 32 ++++++++++++++++++++++++++ > > drivers/gpu/drm/radeon/radeon_drv.c | 3 +-- > > 3 files changed, 34 insertions(+), 2 deletions(-) > > create mode 100644 drivers/gpu/drm/radeon/radeon_device.h > > Other public functions in radeon_device.c have their prototype in > radeon.h - for example radeon_is_px() > > Add radeon_device_is_virtual() there so we avoiid this new header. Oh yes, I remember why this wasn't a suitable solution now: The macro "radeon_init" in radeon.h clashes with the init function of the same name in radeon_drv.c: In file included from drivers/gpu/drm/radeon/radeon_drv.c:53: drivers/gpu/drm/radeon/radeon_drv.c:620:31: error: expected identifier or ‘(’ before ‘void’ 620 | static int __init radeon_init(void) | ^~~~ drivers/gpu/drm/radeon/radeon.h:2705:28: note: in definition of macro ‘radeon_init’ 2705 | #define radeon_init(rdev) (rdev)->asic->init((rdev)) | ^~~~ In file included from drivers/gpu/drm/radeon/radeon_drv.c:35: drivers/gpu/drm/radeon/radeon_drv.c: In function ‘__inittest’: drivers/gpu/drm/radeon/radeon_drv.c:653:13: error: ‘radeon_init’ undeclared (first use in this function); did you mean ‘radeon_exit’? 653 | module_init(radeon_init); | ^~~~~~~~~~~ include/linux/module.h:133:11: note: in definition of macro ‘module_init’ 133 | { return initfn; } | ^~~~~~ drivers/gpu/drm/radeon/radeon_drv.c:653:13: note: each undeclared identifier is reported only once for each function it appears in 653 | module_init(radeon_init); | ^~~~~~~~~~~ include/linux/module.h:133:11: note: in definition of macro ‘module_init’ 133 | { return initfn; } | ^~~~~~ In file included from include/linux/compiler_types.h:65, from : drivers/gpu/drm/radeon/radeon_drv.c: At top level: drivers/gpu/drm/radeon/radeon_drv.c:653:13: error: ‘radeon_init’ undeclared here (not in a function); did you mean ‘radeon_exit’? 653 | module_init(radeon_init); | ^~~~~~~~~~~ include/linux/compiler_attributes.h:109:65: note: in definition of macro ‘__copy’ 109 | # define __copy(symbol) __attribute__((__copy__(symbol))) | ^~~~~~ drivers/gpu/drm/radeon/radeon_drv.c:653:1: note: in expansion of macro ‘module_init’ 653 | module_init(radeon_init); | ^~~~~~~~~~~ In file included from drivers/gpu/drm/radeon/radeon_drv.c:35: include/linux/module.h:134:6: error: ‘init_module’ aliased to undefined symbol ‘radeon_init’ 134 | int init_module(void) __copy(initfn) __attribute__((alias(#initfn))); | ^~~~~~~~~~~ drivers/gpu/drm/radeon/radeon_drv.c:653:1: note: in expansion of macro ‘module_init’ 653 | module_init(radeon_init); | ^~~~~~~~~~~ How would you like me to move forward? -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog