From patchwork Mon Oct 24 16:28:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 78999 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp2670342qge; Mon, 24 Oct 2016 09:29:03 -0700 (PDT) X-Received: by 10.99.39.130 with SMTP id n124mr24664198pgn.85.1477326543533; Mon, 24 Oct 2016 09:29:03 -0700 (PDT) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id k12si16115246pfb.293.2016.10.24.09.29.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Oct 2016 09:29:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6FEDC6E55B; Mon, 24 Oct 2016 16:28:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-x242.google.com (mail-yw0-x242.google.com [IPv6:2607:f8b0:4002:c05::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id D22936E55A for ; Mon, 24 Oct 2016 16:28:30 +0000 (UTC) Received: by mail-yw0-x242.google.com with SMTP id e5so9802588ywc.3 for ; Mon, 24 Oct 2016 09:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=EpT/fM056L31WXDVaxF/rlkvz0Uf01hzjlACAS+Gyx8=; b=WB3ApONogZKLg7Ee7NU8WYHKilsXU5ypde8gBdGlLzXXKAEvogWim9SxSBBzo5ycFM pBTKwBsub9P1etE7nDKDX1OY9rj0ZwcAScEQyibv5C0/4KJy2QkFyQYWXU3XVrjhYxRo VhExnKWdfOhPgTJ63btBGgCUPOT6yUqBSzbc8TcPBFgb9sAEBNayIQAiCXHcY/Me6bwa rQ0uTYtyKkigdL/Y7hDP0V5DSAu2lIXWz33uXd9NxBmhHIwfzPr2rHZtibVbDxTzRoJz gf/zmN5DXIFDvyLVRm5MjV7DR68kMCeWJeyxmiRvzRDQ+xqcCNhBdwfBbPhnxaYHHRl3 NIVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=EpT/fM056L31WXDVaxF/rlkvz0Uf01hzjlACAS+Gyx8=; b=Y/HEq5dPUFqvmr/SM6fL+IQaf4Fn+tBe6D8X0wzBpIvrzLuQq6W+WscQP90liPyx7s GcAd8rQUNDmKPrPSnc0fDGBj8Ny7PQFqVwwnpip4UkLOagXFTBWDfrTArTqu1QRJrIgd MNMB8lbUJEz+8fP6AKRc/AfJAEKf3nAQukzF7DPEPQ/cPduCahPDv06Omo7G/epdmRSn 7XCMpKmJM7dHkJ+8zK99FIiH65zgXSBLQyreOk8SHwlilwZ1aKsf0lZZXujeYHErmzmM 8jYDODBUutglnGihbbWADW/2qpzxf3uSOX3lHToL2olJr3q7kiWckwvNmtjARi4DvP1W /RIA== X-Gm-Message-State: ABUngvd4RiRUbHnHAvvZzy1UQP57WjB7AYTAQXP3J8lILweJ3PLGoQTgAWw3Q42D991srIJrrPk9pCdbiVNbqg== X-Received: by 10.129.73.200 with SMTP id w191mr16203009ywa.288.1477326510041; Mon, 24 Oct 2016 09:28:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.3.142 with HTTP; Mon, 24 Oct 2016 09:28:29 -0700 (PDT) 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: "Zhou, Jammy" , Daniel Vetter , Maling list - DRI developers , LKML , Flora Cui , Gustavo Padovan , Tom St Denis , tang.qiang007@zte.com.cn, Vitaly Prosyak , Alexandre Demers , Arnd Bergmann , xie.baoyou@zte.com.cn, Emily Deng , han.fei@zte.com.cn, Junwei Zhang , =?UTF-8?Q?Nicolai_H=C3=A4hnle?= , Edward O'Callaghan , "Daenzer, Michel" , Carlos Palminha , "Deucher, Alexander" , Ken Wang , Rex Zhu , Christian Koenig X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 >From 3714f3beec519d4e49ce6a482688ae98072979da Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 24 Oct 2016 12:24:11 -0400 Subject: [PATCH] drm/amdgpu: amdgpu_pm_acpi_event_handler definition to a header file Add it to amdgpu_pm.h Fixes 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] Inspired by a similar patch from Baoyou Xie. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c index 5796539..ec22e64 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c @@ -30,10 +30,10 @@ #include #include #include "amdgpu.h" +#include "amdgpu_pm.h" #include "amd_acpi.h" #include "atom.h" -extern void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev); /* Call the ATIF method */ /** diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h index 5fd7734..7e14521 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h @@ -28,6 +28,7 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev); void amdgpu_pm_sysfs_fini(struct amdgpu_device *adev); void amdgpu_pm_print_power_states(struct amdgpu_device *adev); void amdgpu_pm_compute_clocks(struct amdgpu_device *adev); +void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev); void amdgpu_dpm_thermal_work_handler(struct work_struct *work); void amdgpu_dpm_enable_uvd(struct amdgpu_device *adev, bool enable); void amdgpu_dpm_enable_vce(struct amdgpu_device *adev, bool enable); -- 2.5.5