Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965333AbcJXQ3J (ORCPT ); Mon, 24 Oct 2016 12:29:09 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:36067 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965371AbcJXQ2b (ORCPT ); Mon, 24 Oct 2016 12:28:31 -0400 MIME-Version: 1.0 In-Reply-To: <1477126107-2466-3-git-send-email-baoyou.xie@linaro.org> References: <1477126107-2466-1-git-send-email-baoyou.xie@linaro.org> <1477126107-2466-3-git-send-email-baoyou.xie@linaro.org> From: Alex Deucher Date: Mon, 24 Oct 2016 12:28:29 -0400 Message-ID: Subject: Re: [PATCH 3/3] drm/amdgpu: move function declaration to header file To: Baoyou Xie Cc: "Deucher, Alexander" , Christian Koenig , Dave Airlie , =?UTF-8?Q?Nicolai_H=C3=A4hnle?= , "Zhou, Jammy" , Ken Wang , Daniel Vetter , Tom St Denis , "Daenzer, Michel" , Gustavo Padovan , eric.engestrom@imgtec.com, Emily Deng , Chunming Zhou , Carlos Palminha , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , Flora Cui , Vitaly Prosyak , Alexandre Demers , Junwei Zhang , Rex Zhu , "Edward O'Callaghan" , Arnd Bergmann , tang.qiang007@zte.com.cn, xie.baoyou@zte.com.cn, LKML , Maling list - DRI developers , han.fei@zte.com.cn Content-Type: multipart/mixed; boundary=001a114d6eacd96b99053f9ee17b Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5042 Lines: 102 --001a114d6eacd96b99053f9ee17b Content-Type: text/plain; charset=UTF-8 On Sat, Oct 22, 2016 at 4:48 AM, Baoyou Xie wrote: > We get 1 warning when building kernel with W=1: > drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:37:6: warning: no previous prototype for 'amdgpu_pm_acpi_event_handler' [-Wmissing-prototypes] > > In fact, this function is defined in > drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c, but should be declared > in a header file. So this patch moves the function declaration > to drivers/gpu/drm/amd/amdgpu/amdgpu.h. I want to try and avoid making amdgpu.h a random dumping ground for function defs. Let's put it in amdgpu_pm.h instead. How about the attached patch? Alex > > Signed-off-by: Baoyou Xie > --- > drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 ++ > drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 1 - > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > index 039b57e..c0bc42b 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > @@ -2145,6 +2145,8 @@ void amdgpu_io_wreg(struct amdgpu_device *adev, u32 reg, u32 v); > u32 amdgpu_mm_rdoorbell(struct amdgpu_device *adev, u32 index); > void amdgpu_mm_wdoorbell(struct amdgpu_device *adev, u32 index, u32 v); > > +void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev); > + > /* > * Registers read & write functions. > */ > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c > index 5796539..d77d630 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c > @@ -33,7 +33,6 @@ > #include "amd_acpi.h" > #include "atom.h" > > -extern void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev); > /* Call the ATIF method > */ > /** > -- > 2.7.4 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel --001a114d6eacd96b99053f9ee17b Content-Type: text/x-patch; charset=US-ASCII; name="0001-drm-amdgpu-amdgpu_pm_acpi_event_handler-definition-t.patch" Content-Disposition: attachment; filename="0001-drm-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