[PATCH] drm/amdgpu: mark symbols static where possible

2016-09-30 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/si.c:908:5: warning: no previous prototype for 
'si_pciep_rreg' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/si.c:921:6: warning: no previous prototype for 
'si_pciep_wreg' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/si.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index dc9511c..bacdff8 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -905,7 +905,7 @@ static void si_pcie_wreg(struct amdgpu_device *adev, u32 
reg, u32 v)
spin_unlock_irqrestore(>pcie_idx_lock, flags);
 }
 
-u32 si_pciep_rreg(struct amdgpu_device *adev, u32 reg)
+static u32 si_pciep_rreg(struct amdgpu_device *adev, u32 reg)
 {
unsigned long flags;
u32 r;
@@ -918,7 +918,7 @@ u32 si_pciep_rreg(struct amdgpu_device *adev, u32 reg)
return r;
 }
 
-void si_pciep_wreg(struct amdgpu_device *adev, u32 reg, u32 v)
+static void si_pciep_wreg(struct amdgpu_device *adev, u32 reg, u32 v)
 {
unsigned long flags;
 
-- 
2.7.4



[PATCH] drm/amdgpu: mark symbols static where possible

2016-09-30 Thread Baoyou Xie
We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/si.c:908:5: warning: no previous prototype for 
'si_pciep_rreg' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/si.c:921:6: warning: no previous prototype for 
'si_pciep_wreg' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/si.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index dc9511c..bacdff8 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -905,7 +905,7 @@ static void si_pcie_wreg(struct amdgpu_device *adev, u32 
reg, u32 v)
spin_unlock_irqrestore(>pcie_idx_lock, flags);
 }
 
-u32 si_pciep_rreg(struct amdgpu_device *adev, u32 reg)
+static u32 si_pciep_rreg(struct amdgpu_device *adev, u32 reg)
 {
unsigned long flags;
u32 r;
@@ -918,7 +918,7 @@ u32 si_pciep_rreg(struct amdgpu_device *adev, u32 reg)
return r;
 }
 
-void si_pciep_wreg(struct amdgpu_device *adev, u32 reg, u32 v)
+static void si_pciep_wreg(struct amdgpu_device *adev, u32 reg, u32 v)
 {
unsigned long flags;
 
-- 
2.7.4



Re: [PATCH] drm/amdgpu: mark symbols static where possible

2016-09-19 Thread Alex Deucher
On Mon, Sep 19, 2016 at 6:01 AM, Christian König
 wrote:
> Am 18.09.2016 um 16:09 schrieb Baoyou Xie:
>>
>> We get 7 warnings when building kernel with W=1:
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1990:5: warning: no previous
>> prototype for 'amdgpu_pre_soft_reset' [-Wmissing-prototypes]
>> drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1548:5: warning: no
>> previous prototype for 'amdgpu_connector_virtual_dpms'
>> [-Wmissing-prototypes]
>> drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1560:5: warning: no
>> previous prototype for 'amdgpu_connector_virtual_set_property'
>> [-Wmissing-prototypes]
>> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:330:5: warning: no previous
>> prototype for 'amdgpu_cs_list_validate' [-Wmissing-prototypes]
>> drivers/gpu/drm/amd/amdgpu/dce_virtual.c:98:6: warning: no previous
>> prototype for 'dce_virtual_stop_mc_access' [-Wmissing-prototypes]
>> drivers/gpu/drm/amd/amdgpu/dce_virtual.c:130:6: warning: no previous
>> prototype for 'dce_virtual_resume_mc_access' [-Wmissing-prototypes]
>> drivers/gpu/drm/amd/amdgpu/dce_virtual.c:136:6: warning: no previous
>> prototype for 'dce_virtual_set_vga_render_state' [-Wmissing-prototypes]
>>
>> In fact, all of the functions are only used in the file
>> in which they are declared and don't need a declaration,
>> but can be made static.
>>
>> So this patch marks both functions with 'static'.
>>
>> Signed-off-by: Baoyou Xie 
>
>
> Reviewed-by: Christian König .
>

Applied.  thanks!

Alex

>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 6 --
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
>>   drivers/gpu/drm/amd/amdgpu/dce_virtual.c   | 6 +++---
>>   4 files changed, 9 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
>> index 319a5e1..decbba5 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
>> @@ -1545,7 +1545,8 @@ static int
>> amdgpu_connector_virtual_mode_valid(struct drm_connector *connector,
>> return MODE_OK;
>>   }
>>   -int amdgpu_connector_virtual_dpms(struct drm_connector *connector, int
>> mode)
>> +static int
>> +amdgpu_connector_virtual_dpms(struct drm_connector *connector, int mode)
>>   {
>> return 0;
>>   }
>> @@ -1557,7 +1558,8 @@ amdgpu_connector_virtual_detect(struct drm_connector
>> *connector, bool force)
>> return connector_status_connected;
>>   }
>>   -int amdgpu_connector_virtual_set_property(struct drm_connector
>> *connector,
>> +static int
>> +amdgpu_connector_virtual_set_property(struct drm_connector *connector,
>>   struct drm_property *property,
>>   uint64_t val)
>>   {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> index d80e5d3..b408eea 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> @@ -327,7 +327,7 @@ retry:
>> return r;
>>   }
>>   -int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
>> +static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
>> struct list_head *validated)
>>   {
>> struct amdgpu_bo_list_entry *lobj;
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> index c38dc47..09b809d 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> @@ -1987,7 +1987,7 @@ static bool amdgpu_check_soft_reset(struct
>> amdgpu_device *adev)
>> return asic_hang;
>>   }
>>   -int amdgpu_pre_soft_reset(struct amdgpu_device *adev)
>> +static int amdgpu_pre_soft_reset(struct amdgpu_device *adev)
>>   {
>> int i, r = 0;
>>   diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
>> b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
>> index 00663a7..2d02acd 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
>> @@ -95,7 +95,7 @@ static bool dce_virtual_is_display_hung(struct
>> amdgpu_device *adev)
>> return false;
>>   }
>>   -void dce_virtual_stop_mc_access(struct amdgpu_device *adev,
>> +static void dce_virtual_stop_mc_access(struct amdgpu_device *adev,
>>   struct amdgpu_mode_mc_save *save)
>>   {
>> switch (adev->asic_type) {
>> @@ -127,13 +127,13 @@ void dce_virtual_stop_mc_access(struct amdgpu_device
>> *adev,
>> return;
>>   }
>> -void dce_virtual_resume_mc_access(struct amdgpu_device *adev,
>> +static void dce_virtual_resume_mc_access(struct amdgpu_device *adev,
>> struct amdgpu_mode_mc_save *save)
>>   {
>> return;
>>   }
>>   -void 

Re: [PATCH] drm/amdgpu: mark symbols static where possible

2016-09-19 Thread Alex Deucher
On Mon, Sep 19, 2016 at 6:01 AM, Christian König
 wrote:
> Am 18.09.2016 um 16:09 schrieb Baoyou Xie:
>>
>> We get 7 warnings when building kernel with W=1:
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1990:5: warning: no previous
>> prototype for 'amdgpu_pre_soft_reset' [-Wmissing-prototypes]
>> drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1548:5: warning: no
>> previous prototype for 'amdgpu_connector_virtual_dpms'
>> [-Wmissing-prototypes]
>> drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1560:5: warning: no
>> previous prototype for 'amdgpu_connector_virtual_set_property'
>> [-Wmissing-prototypes]
>> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:330:5: warning: no previous
>> prototype for 'amdgpu_cs_list_validate' [-Wmissing-prototypes]
>> drivers/gpu/drm/amd/amdgpu/dce_virtual.c:98:6: warning: no previous
>> prototype for 'dce_virtual_stop_mc_access' [-Wmissing-prototypes]
>> drivers/gpu/drm/amd/amdgpu/dce_virtual.c:130:6: warning: no previous
>> prototype for 'dce_virtual_resume_mc_access' [-Wmissing-prototypes]
>> drivers/gpu/drm/amd/amdgpu/dce_virtual.c:136:6: warning: no previous
>> prototype for 'dce_virtual_set_vga_render_state' [-Wmissing-prototypes]
>>
>> In fact, all of the functions are only used in the file
>> in which they are declared and don't need a declaration,
>> but can be made static.
>>
>> So this patch marks both functions with 'static'.
>>
>> Signed-off-by: Baoyou Xie 
>
>
> Reviewed-by: Christian König .
>

Applied.  thanks!

Alex

>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 6 --
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
>>   drivers/gpu/drm/amd/amdgpu/dce_virtual.c   | 6 +++---
>>   4 files changed, 9 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
>> index 319a5e1..decbba5 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
>> @@ -1545,7 +1545,8 @@ static int
>> amdgpu_connector_virtual_mode_valid(struct drm_connector *connector,
>> return MODE_OK;
>>   }
>>   -int amdgpu_connector_virtual_dpms(struct drm_connector *connector, int
>> mode)
>> +static int
>> +amdgpu_connector_virtual_dpms(struct drm_connector *connector, int mode)
>>   {
>> return 0;
>>   }
>> @@ -1557,7 +1558,8 @@ amdgpu_connector_virtual_detect(struct drm_connector
>> *connector, bool force)
>> return connector_status_connected;
>>   }
>>   -int amdgpu_connector_virtual_set_property(struct drm_connector
>> *connector,
>> +static int
>> +amdgpu_connector_virtual_set_property(struct drm_connector *connector,
>>   struct drm_property *property,
>>   uint64_t val)
>>   {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> index d80e5d3..b408eea 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> @@ -327,7 +327,7 @@ retry:
>> return r;
>>   }
>>   -int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
>> +static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
>> struct list_head *validated)
>>   {
>> struct amdgpu_bo_list_entry *lobj;
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> index c38dc47..09b809d 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> @@ -1987,7 +1987,7 @@ static bool amdgpu_check_soft_reset(struct
>> amdgpu_device *adev)
>> return asic_hang;
>>   }
>>   -int amdgpu_pre_soft_reset(struct amdgpu_device *adev)
>> +static int amdgpu_pre_soft_reset(struct amdgpu_device *adev)
>>   {
>> int i, r = 0;
>>   diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
>> b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
>> index 00663a7..2d02acd 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
>> @@ -95,7 +95,7 @@ static bool dce_virtual_is_display_hung(struct
>> amdgpu_device *adev)
>> return false;
>>   }
>>   -void dce_virtual_stop_mc_access(struct amdgpu_device *adev,
>> +static void dce_virtual_stop_mc_access(struct amdgpu_device *adev,
>>   struct amdgpu_mode_mc_save *save)
>>   {
>> switch (adev->asic_type) {
>> @@ -127,13 +127,13 @@ void dce_virtual_stop_mc_access(struct amdgpu_device
>> *adev,
>> return;
>>   }
>> -void dce_virtual_resume_mc_access(struct amdgpu_device *adev,
>> +static void dce_virtual_resume_mc_access(struct amdgpu_device *adev,
>> struct amdgpu_mode_mc_save *save)
>>   {
>> return;
>>   }
>>   -void dce_virtual_set_vga_render_state(struct amdgpu_device *adev,
>> +static void 

Re: [PATCH] drm/amdgpu: mark symbols static where possible

2016-09-19 Thread Christian König

Am 18.09.2016 um 16:09 schrieb Baoyou Xie:

We get 7 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1990:5: warning: no previous 
prototype for 'amdgpu_pre_soft_reset' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1548:5: warning: no previous 
prototype for 'amdgpu_connector_virtual_dpms' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1560:5: warning: no previous 
prototype for 'amdgpu_connector_virtual_set_property' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:330:5: warning: no previous prototype 
for 'amdgpu_cs_list_validate' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:98:6: warning: no previous prototype 
for 'dce_virtual_stop_mc_access' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:130:6: warning: no previous prototype 
for 'dce_virtual_resume_mc_access' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:136:6: warning: no previous prototype 
for 'dce_virtual_set_vga_render_state' [-Wmissing-prototypes]

In fact, all of the functions are only used in the file
in which they are declared and don't need a declaration,
but can be made static.

So this patch marks both functions with 'static'.

Signed-off-by: Baoyou Xie 


Reviewed-by: Christian König .


---
  drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 6 --
  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
  drivers/gpu/drm/amd/amdgpu/dce_virtual.c   | 6 +++---
  4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index 319a5e1..decbba5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -1545,7 +1545,8 @@ static int amdgpu_connector_virtual_mode_valid(struct 
drm_connector *connector,
return MODE_OK;
  }
  
-int amdgpu_connector_virtual_dpms(struct drm_connector *connector, int mode)

+static int
+amdgpu_connector_virtual_dpms(struct drm_connector *connector, int mode)
  {
return 0;
  }
@@ -1557,7 +1558,8 @@ amdgpu_connector_virtual_detect(struct drm_connector 
*connector, bool force)
return connector_status_connected;
  }
  
-int amdgpu_connector_virtual_set_property(struct drm_connector *connector,

+static int
+amdgpu_connector_virtual_set_property(struct drm_connector *connector,
  struct drm_property *property,
  uint64_t val)
  {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index d80e5d3..b408eea 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -327,7 +327,7 @@ retry:
return r;
  }
  
-int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,

+static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
struct list_head *validated)
  {
struct amdgpu_bo_list_entry *lobj;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index c38dc47..09b809d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1987,7 +1987,7 @@ static bool amdgpu_check_soft_reset(struct amdgpu_device 
*adev)
return asic_hang;
  }
  
-int amdgpu_pre_soft_reset(struct amdgpu_device *adev)

+static int amdgpu_pre_soft_reset(struct amdgpu_device *adev)
  {
int i, r = 0;
  
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c

index 00663a7..2d02acd 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
@@ -95,7 +95,7 @@ static bool dce_virtual_is_display_hung(struct amdgpu_device 
*adev)
return false;
  }
  
-void dce_virtual_stop_mc_access(struct amdgpu_device *adev,

+static void dce_virtual_stop_mc_access(struct amdgpu_device *adev,
  struct amdgpu_mode_mc_save *save)
  {
switch (adev->asic_type) {
@@ -127,13 +127,13 @@ void dce_virtual_stop_mc_access(struct amdgpu_device 
*adev,
  
  	return;

  }
-void dce_virtual_resume_mc_access(struct amdgpu_device *adev,
+static void dce_virtual_resume_mc_access(struct amdgpu_device *adev,
struct amdgpu_mode_mc_save *save)
  {
return;
  }
  
-void dce_virtual_set_vga_render_state(struct amdgpu_device *adev,

+static void dce_virtual_set_vga_render_state(struct amdgpu_device *adev,
bool render)
  {
return;





Re: [PATCH] drm/amdgpu: mark symbols static where possible

2016-09-19 Thread Christian König

Am 18.09.2016 um 16:09 schrieb Baoyou Xie:

We get 7 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1990:5: warning: no previous 
prototype for 'amdgpu_pre_soft_reset' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1548:5: warning: no previous 
prototype for 'amdgpu_connector_virtual_dpms' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1560:5: warning: no previous 
prototype for 'amdgpu_connector_virtual_set_property' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:330:5: warning: no previous prototype 
for 'amdgpu_cs_list_validate' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:98:6: warning: no previous prototype 
for 'dce_virtual_stop_mc_access' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:130:6: warning: no previous prototype 
for 'dce_virtual_resume_mc_access' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:136:6: warning: no previous prototype 
for 'dce_virtual_set_vga_render_state' [-Wmissing-prototypes]

In fact, all of the functions are only used in the file
in which they are declared and don't need a declaration,
but can be made static.

So this patch marks both functions with 'static'.

Signed-off-by: Baoyou Xie 


Reviewed-by: Christian König .


---
  drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 6 --
  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
  drivers/gpu/drm/amd/amdgpu/dce_virtual.c   | 6 +++---
  4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index 319a5e1..decbba5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -1545,7 +1545,8 @@ static int amdgpu_connector_virtual_mode_valid(struct 
drm_connector *connector,
return MODE_OK;
  }
  
-int amdgpu_connector_virtual_dpms(struct drm_connector *connector, int mode)

+static int
+amdgpu_connector_virtual_dpms(struct drm_connector *connector, int mode)
  {
return 0;
  }
@@ -1557,7 +1558,8 @@ amdgpu_connector_virtual_detect(struct drm_connector 
*connector, bool force)
return connector_status_connected;
  }
  
-int amdgpu_connector_virtual_set_property(struct drm_connector *connector,

+static int
+amdgpu_connector_virtual_set_property(struct drm_connector *connector,
  struct drm_property *property,
  uint64_t val)
  {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index d80e5d3..b408eea 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -327,7 +327,7 @@ retry:
return r;
  }
  
-int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,

+static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
struct list_head *validated)
  {
struct amdgpu_bo_list_entry *lobj;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index c38dc47..09b809d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1987,7 +1987,7 @@ static bool amdgpu_check_soft_reset(struct amdgpu_device 
*adev)
return asic_hang;
  }
  
-int amdgpu_pre_soft_reset(struct amdgpu_device *adev)

+static int amdgpu_pre_soft_reset(struct amdgpu_device *adev)
  {
int i, r = 0;
  
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c

index 00663a7..2d02acd 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
@@ -95,7 +95,7 @@ static bool dce_virtual_is_display_hung(struct amdgpu_device 
*adev)
return false;
  }
  
-void dce_virtual_stop_mc_access(struct amdgpu_device *adev,

+static void dce_virtual_stop_mc_access(struct amdgpu_device *adev,
  struct amdgpu_mode_mc_save *save)
  {
switch (adev->asic_type) {
@@ -127,13 +127,13 @@ void dce_virtual_stop_mc_access(struct amdgpu_device 
*adev,
  
  	return;

  }
-void dce_virtual_resume_mc_access(struct amdgpu_device *adev,
+static void dce_virtual_resume_mc_access(struct amdgpu_device *adev,
struct amdgpu_mode_mc_save *save)
  {
return;
  }
  
-void dce_virtual_set_vga_render_state(struct amdgpu_device *adev,

+static void dce_virtual_set_vga_render_state(struct amdgpu_device *adev,
bool render)
  {
return;





[PATCH] drm/amdgpu: mark symbols static where possible

2016-09-18 Thread Baoyou Xie
We get 7 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1990:5: warning: no previous 
prototype for 'amdgpu_pre_soft_reset' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1548:5: warning: no previous 
prototype for 'amdgpu_connector_virtual_dpms' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1560:5: warning: no previous 
prototype for 'amdgpu_connector_virtual_set_property' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:330:5: warning: no previous prototype 
for 'amdgpu_cs_list_validate' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:98:6: warning: no previous prototype 
for 'dce_virtual_stop_mc_access' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:130:6: warning: no previous prototype 
for 'dce_virtual_resume_mc_access' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:136:6: warning: no previous prototype 
for 'dce_virtual_set_vga_render_state' [-Wmissing-prototypes]

In fact, all of the functions are only used in the file
in which they are declared and don't need a declaration,
but can be made static.

So this patch marks both functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 6 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/dce_virtual.c   | 6 +++---
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index 319a5e1..decbba5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -1545,7 +1545,8 @@ static int amdgpu_connector_virtual_mode_valid(struct 
drm_connector *connector,
return MODE_OK;
 }
 
-int amdgpu_connector_virtual_dpms(struct drm_connector *connector, int mode)
+static int
+amdgpu_connector_virtual_dpms(struct drm_connector *connector, int mode)
 {
return 0;
 }
@@ -1557,7 +1558,8 @@ amdgpu_connector_virtual_detect(struct drm_connector 
*connector, bool force)
return connector_status_connected;
 }
 
-int amdgpu_connector_virtual_set_property(struct drm_connector *connector,
+static int
+amdgpu_connector_virtual_set_property(struct drm_connector *connector,
  struct drm_property *property,
  uint64_t val)
 {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index d80e5d3..b408eea 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -327,7 +327,7 @@ retry:
return r;
 }
 
-int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
+static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
struct list_head *validated)
 {
struct amdgpu_bo_list_entry *lobj;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index c38dc47..09b809d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1987,7 +1987,7 @@ static bool amdgpu_check_soft_reset(struct amdgpu_device 
*adev)
return asic_hang;
 }
 
-int amdgpu_pre_soft_reset(struct amdgpu_device *adev)
+static int amdgpu_pre_soft_reset(struct amdgpu_device *adev)
 {
int i, r = 0;
 
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c 
b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
index 00663a7..2d02acd 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
@@ -95,7 +95,7 @@ static bool dce_virtual_is_display_hung(struct amdgpu_device 
*adev)
return false;
 }
 
-void dce_virtual_stop_mc_access(struct amdgpu_device *adev,
+static void dce_virtual_stop_mc_access(struct amdgpu_device *adev,
  struct amdgpu_mode_mc_save *save)
 {
switch (adev->asic_type) {
@@ -127,13 +127,13 @@ void dce_virtual_stop_mc_access(struct amdgpu_device 
*adev,
 
return;
 }
-void dce_virtual_resume_mc_access(struct amdgpu_device *adev,
+static void dce_virtual_resume_mc_access(struct amdgpu_device *adev,
struct amdgpu_mode_mc_save *save)
 {
return;
 }
 
-void dce_virtual_set_vga_render_state(struct amdgpu_device *adev,
+static void dce_virtual_set_vga_render_state(struct amdgpu_device *adev,
bool render)
 {
return;
-- 
2.7.4



[PATCH] drm/amdgpu: mark symbols static where possible

2016-09-18 Thread Baoyou Xie
We get 7 warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1990:5: warning: no previous 
prototype for 'amdgpu_pre_soft_reset' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1548:5: warning: no previous 
prototype for 'amdgpu_connector_virtual_dpms' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c:1560:5: warning: no previous 
prototype for 'amdgpu_connector_virtual_set_property' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:330:5: warning: no previous prototype 
for 'amdgpu_cs_list_validate' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:98:6: warning: no previous prototype 
for 'dce_virtual_stop_mc_access' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:130:6: warning: no previous prototype 
for 'dce_virtual_resume_mc_access' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c:136:6: warning: no previous prototype 
for 'dce_virtual_set_vga_render_state' [-Wmissing-prototypes]

In fact, all of the functions are only used in the file
in which they are declared and don't need a declaration,
but can be made static.

So this patch marks both functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 6 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/dce_virtual.c   | 6 +++---
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index 319a5e1..decbba5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -1545,7 +1545,8 @@ static int amdgpu_connector_virtual_mode_valid(struct 
drm_connector *connector,
return MODE_OK;
 }
 
-int amdgpu_connector_virtual_dpms(struct drm_connector *connector, int mode)
+static int
+amdgpu_connector_virtual_dpms(struct drm_connector *connector, int mode)
 {
return 0;
 }
@@ -1557,7 +1558,8 @@ amdgpu_connector_virtual_detect(struct drm_connector 
*connector, bool force)
return connector_status_connected;
 }
 
-int amdgpu_connector_virtual_set_property(struct drm_connector *connector,
+static int
+amdgpu_connector_virtual_set_property(struct drm_connector *connector,
  struct drm_property *property,
  uint64_t val)
 {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index d80e5d3..b408eea 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -327,7 +327,7 @@ retry:
return r;
 }
 
-int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
+static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
struct list_head *validated)
 {
struct amdgpu_bo_list_entry *lobj;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index c38dc47..09b809d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1987,7 +1987,7 @@ static bool amdgpu_check_soft_reset(struct amdgpu_device 
*adev)
return asic_hang;
 }
 
-int amdgpu_pre_soft_reset(struct amdgpu_device *adev)
+static int amdgpu_pre_soft_reset(struct amdgpu_device *adev)
 {
int i, r = 0;
 
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c 
b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
index 00663a7..2d02acd 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
@@ -95,7 +95,7 @@ static bool dce_virtual_is_display_hung(struct amdgpu_device 
*adev)
return false;
 }
 
-void dce_virtual_stop_mc_access(struct amdgpu_device *adev,
+static void dce_virtual_stop_mc_access(struct amdgpu_device *adev,
  struct amdgpu_mode_mc_save *save)
 {
switch (adev->asic_type) {
@@ -127,13 +127,13 @@ void dce_virtual_stop_mc_access(struct amdgpu_device 
*adev,
 
return;
 }
-void dce_virtual_resume_mc_access(struct amdgpu_device *adev,
+static void dce_virtual_resume_mc_access(struct amdgpu_device *adev,
struct amdgpu_mode_mc_save *save)
 {
return;
 }
 
-void dce_virtual_set_vga_render_state(struct amdgpu_device *adev,
+static void dce_virtual_set_vga_render_state(struct amdgpu_device *adev,
bool render)
 {
return;
-- 
2.7.4



Re: [PATCH] drm: amdgpu: mark symbols static where possible

2016-09-03 Thread Christian König

Am 03.09.2016 um 07:57 schrieb Baoyou Xie:

We get a few warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/cz_smc.c:51:5: warning: no previous prototype for 
'cz_send_msg_to_smc_async' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/cz_smc.c:143:5: warning: no previous prototype for 
'cz_write_smc_sram_dword' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/iceland_smc.c:124:6: warning: no previous prototype 
for 'iceland_start_smc' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:3926:6: warning: no previous prototype 
for 'gfx_v8_0_rlc_stop' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c:94:6: warning: no previous prototype 
for 'amdgpu_job_free_cb' [-Wmissing-prototypes]


In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 


Reviewed-by: Christian König .


---
  drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c  | 4 ++--
  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c   | 2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_job.c  | 2 +-
  drivers/gpu/drm/amd/amdgpu/cz_smc.c  | 4 ++--
  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c| 2 +-
  drivers/gpu/drm/amd/amdgpu/iceland_smc.c | 8 
  6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
index bc0440f..a831218 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
@@ -616,7 +616,7 @@ static int amdgpu_cgs_irq_put(struct cgs_device 
*cgs_device, unsigned src_id, un
return amdgpu_irq_put(adev, adev->irq.sources[src_id], type);
  }
  
-int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device,

+static int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device,
  enum amd_ip_block_type block_type,
  enum amd_clockgating_state state)
  {
@@ -637,7 +637,7 @@ int amdgpu_cgs_set_clockgating_state(struct cgs_device 
*cgs_device,
return r;
  }
  
-int amdgpu_cgs_set_powergating_state(struct cgs_device *cgs_device,

+static int amdgpu_cgs_set_powergating_state(struct cgs_device *cgs_device,
  enum amd_ip_block_type block_type,
  enum amd_powergating_state state)
  {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 0307ff5..f65bdaf 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -287,7 +287,7 @@ static u64 amdgpu_cs_get_threshold_for_moves(struct 
amdgpu_device *adev)
return max(bytes_moved_threshold, 1024*1024ull);
  }
  
-int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,

+static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
struct list_head *validated)
  {
struct amdgpu_bo_list_entry *lobj;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index 6674d40..31bfe3a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -91,7 +91,7 @@ void amdgpu_job_free_resources(struct amdgpu_job *job)
amdgpu_ib_free(job->adev, >ibs[i], f);
  }
  
-void amdgpu_job_free_cb(struct amd_sched_job *s_job)

+static void amdgpu_job_free_cb(struct amd_sched_job *s_job)
  {
struct amdgpu_job *job = container_of(s_job, struct amdgpu_job, base);
  
diff --git a/drivers/gpu/drm/amd/amdgpu/cz_smc.c b/drivers/gpu/drm/amd/amdgpu/cz_smc.c

index ac7fee7..c80c2e9 100644
--- a/drivers/gpu/drm/amd/amdgpu/cz_smc.c
+++ b/drivers/gpu/drm/amd/amdgpu/cz_smc.c
@@ -48,7 +48,7 @@ static struct cz_smu_private_data *cz_smu_get_priv(struct 
amdgpu_device *adev)
return priv;
  }
  
-int cz_send_msg_to_smc_async(struct amdgpu_device *adev, u16 msg)

+static int cz_send_msg_to_smc_async(struct amdgpu_device *adev, u16 msg)
  {
int i;
u32 content = 0, tmp;
@@ -140,7 +140,7 @@ int cz_read_smc_sram_dword(struct amdgpu_device *adev, u32 
smc_address,
return 0;
  }
  
-int cz_write_smc_sram_dword(struct amdgpu_device *adev, u32 smc_address,

+static int cz_write_smc_sram_dword(struct amdgpu_device *adev, u32 smc_address,
u32 value, u32 limit)
  {
int ret;
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index bff8668..6997f7c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -3923,7 +3923,7 @@ static void gfx_v8_0_init_pg(struct amdgpu_device *adev)
}
  }
  
-void gfx_v8_0_rlc_stop(struct amdgpu_device *adev)

+static void gfx_v8_0_rlc_stop(struct amdgpu_device *adev)
  {
u32 tmp = RREG32(mmRLC_CNTL);
  
diff --git 

Re: [PATCH] drm: amdgpu: mark symbols static where possible

2016-09-03 Thread Christian König

Am 03.09.2016 um 07:57 schrieb Baoyou Xie:

We get a few warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/cz_smc.c:51:5: warning: no previous prototype for 
'cz_send_msg_to_smc_async' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/cz_smc.c:143:5: warning: no previous prototype for 
'cz_write_smc_sram_dword' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/iceland_smc.c:124:6: warning: no previous prototype 
for 'iceland_start_smc' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:3926:6: warning: no previous prototype 
for 'gfx_v8_0_rlc_stop' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c:94:6: warning: no previous prototype 
for 'amdgpu_job_free_cb' [-Wmissing-prototypes]


In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 


Reviewed-by: Christian König .


---
  drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c  | 4 ++--
  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c   | 2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_job.c  | 2 +-
  drivers/gpu/drm/amd/amdgpu/cz_smc.c  | 4 ++--
  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c| 2 +-
  drivers/gpu/drm/amd/amdgpu/iceland_smc.c | 8 
  6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
index bc0440f..a831218 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
@@ -616,7 +616,7 @@ static int amdgpu_cgs_irq_put(struct cgs_device 
*cgs_device, unsigned src_id, un
return amdgpu_irq_put(adev, adev->irq.sources[src_id], type);
  }
  
-int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device,

+static int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device,
  enum amd_ip_block_type block_type,
  enum amd_clockgating_state state)
  {
@@ -637,7 +637,7 @@ int amdgpu_cgs_set_clockgating_state(struct cgs_device 
*cgs_device,
return r;
  }
  
-int amdgpu_cgs_set_powergating_state(struct cgs_device *cgs_device,

+static int amdgpu_cgs_set_powergating_state(struct cgs_device *cgs_device,
  enum amd_ip_block_type block_type,
  enum amd_powergating_state state)
  {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 0307ff5..f65bdaf 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -287,7 +287,7 @@ static u64 amdgpu_cs_get_threshold_for_moves(struct 
amdgpu_device *adev)
return max(bytes_moved_threshold, 1024*1024ull);
  }
  
-int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,

+static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
struct list_head *validated)
  {
struct amdgpu_bo_list_entry *lobj;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index 6674d40..31bfe3a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -91,7 +91,7 @@ void amdgpu_job_free_resources(struct amdgpu_job *job)
amdgpu_ib_free(job->adev, >ibs[i], f);
  }
  
-void amdgpu_job_free_cb(struct amd_sched_job *s_job)

+static void amdgpu_job_free_cb(struct amd_sched_job *s_job)
  {
struct amdgpu_job *job = container_of(s_job, struct amdgpu_job, base);
  
diff --git a/drivers/gpu/drm/amd/amdgpu/cz_smc.c b/drivers/gpu/drm/amd/amdgpu/cz_smc.c

index ac7fee7..c80c2e9 100644
--- a/drivers/gpu/drm/amd/amdgpu/cz_smc.c
+++ b/drivers/gpu/drm/amd/amdgpu/cz_smc.c
@@ -48,7 +48,7 @@ static struct cz_smu_private_data *cz_smu_get_priv(struct 
amdgpu_device *adev)
return priv;
  }
  
-int cz_send_msg_to_smc_async(struct amdgpu_device *adev, u16 msg)

+static int cz_send_msg_to_smc_async(struct amdgpu_device *adev, u16 msg)
  {
int i;
u32 content = 0, tmp;
@@ -140,7 +140,7 @@ int cz_read_smc_sram_dword(struct amdgpu_device *adev, u32 
smc_address,
return 0;
  }
  
-int cz_write_smc_sram_dword(struct amdgpu_device *adev, u32 smc_address,

+static int cz_write_smc_sram_dword(struct amdgpu_device *adev, u32 smc_address,
u32 value, u32 limit)
  {
int ret;
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index bff8668..6997f7c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -3923,7 +3923,7 @@ static void gfx_v8_0_init_pg(struct amdgpu_device *adev)
}
  }
  
-void gfx_v8_0_rlc_stop(struct amdgpu_device *adev)

+static void gfx_v8_0_rlc_stop(struct amdgpu_device *adev)
  {
u32 tmp = RREG32(mmRLC_CNTL);
  
diff --git a/drivers/gpu/drm/amd/amdgpu/iceland_smc.c 

Re: [PATCH] drm: amdgpu: mark symbols static where possible

2016-09-03 Thread Huang Rui
On Sat, Sep 03, 2016 at 01:57:14PM +0800, Baoyou Xie wrote:
> We get a few warnings when building kernel with W=1:
> drivers/gpu/drm/amd/amdgpu/cz_smc.c:51:5: warning: no previous prototype for 
> 'cz_send_msg_to_smc_async' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/cz_smc.c:143:5: warning: no previous prototype for 
> 'cz_write_smc_sram_dword' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/iceland_smc.c:124:6: warning: no previous 
> prototype for 'iceland_start_smc' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:3926:6: warning: no previous prototype 
> for 'gfx_v8_0_rlc_stop' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/amdgpu_job.c:94:6: warning: no previous prototype 
> for 'amdgpu_job_free_cb' [-Wmissing-prototypes]
> 
> 
> In fact, these functions are only used in the file in which they are
> declared and don't need a declaration, but can be made static.
> So this patch marks these functions with 'static'.
> 
> Signed-off-by: Baoyou Xie 

Thanks.

Acked-by: Huang Rui 


Re: [PATCH] drm: amdgpu: mark symbols static where possible

2016-09-03 Thread Huang Rui
On Sat, Sep 03, 2016 at 01:57:14PM +0800, Baoyou Xie wrote:
> We get a few warnings when building kernel with W=1:
> drivers/gpu/drm/amd/amdgpu/cz_smc.c:51:5: warning: no previous prototype for 
> 'cz_send_msg_to_smc_async' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/cz_smc.c:143:5: warning: no previous prototype for 
> 'cz_write_smc_sram_dword' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/iceland_smc.c:124:6: warning: no previous 
> prototype for 'iceland_start_smc' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:3926:6: warning: no previous prototype 
> for 'gfx_v8_0_rlc_stop' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/amdgpu_job.c:94:6: warning: no previous prototype 
> for 'amdgpu_job_free_cb' [-Wmissing-prototypes]
> 
> 
> In fact, these functions are only used in the file in which they are
> declared and don't need a declaration, but can be made static.
> So this patch marks these functions with 'static'.
> 
> Signed-off-by: Baoyou Xie 

Thanks.

Acked-by: Huang Rui 


Re: [PATCH] drm: amdgpu: mark symbols static where possible

2016-09-03 Thread Edward O'Callaghan


On 09/03/2016 04:23 PM, Baoyou Xie wrote:
> in drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c and
> drivers/gpu/drm/amd/amdgpu/cz_smc.c, there are two functions named
> cz_write_smc_sram_dword, but these two functions only have the same
> name, but in fact they are different functions, even their declarations
> is different.

Are you sure? Because apart from the crazy macro chain they look like
they wind up being the same to me.

> 
> On 3 September 2016 at 14:11, Edward O'Callaghan
> > wrote:
> 
> Reviewed-by: Edward O'Callaghan  >
> 
> Also, I just noticed cz_write_smc_sram_dword() and if I am not mistaken
> they seems identical in both:
>   drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c  and,
>   drivers/gpu/drm/amd/amdgpu/cz_smc.c
> with a personal preference to the powerplay version I suppose.
> 
> Similar story with cz_send_msg_to_smc_async() *I think* but the
> powerplay one uses some insane macro chain that dispatches to some
> function called smum_wait_for_register_unequal(), quite hard to follow..
> 
> Any way, that is out of scope of the patch here.
> 
> Kind Regards,
> Edward.
> 
> On 09/03/2016 03:57 PM, Baoyou Xie wrote:
> > We get a few warnings when building kernel with W=1:
> > drivers/gpu/drm/amd/amdgpu/cz_smc.c:51:5: warning: no previous
> prototype for 'cz_send_msg_to_smc_async' [-Wmissing-prototypes]
> > drivers/gpu/drm/amd/amdgpu/cz_smc.c:143:5: warning: no previous
> prototype for 'cz_write_smc_sram_dword' [-Wmissing-prototypes]
> > drivers/gpu/drm/amd/amdgpu/iceland_smc.c:124:6: warning: no
> previous prototype for 'iceland_start_smc' [-Wmissing-prototypes]
> > drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:3926:6: warning: no previous
> prototype for 'gfx_v8_0_rlc_stop' [-Wmissing-prototypes]
> > drivers/gpu/drm/amd/amdgpu/amdgpu_job.c:94:6: warning: no previous
> prototype for 'amdgpu_job_free_cb' [-Wmissing-prototypes]
> > 
> >
> > In fact, these functions are only used in the file in which they are
> > declared and don't need a declaration, but can be made static.
> > So this patch marks these functions with 'static'.
> >
> > Signed-off-by: Baoyou Xie  >
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c  | 4 ++--
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c   | 2 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_job.c  | 2 +-
> >  drivers/gpu/drm/amd/amdgpu/cz_smc.c  | 4 ++--
> >  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c| 2 +-
> >  drivers/gpu/drm/amd/amdgpu/iceland_smc.c | 8 
> >  6 files changed, 11 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> > index bc0440f..a831218 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> > @@ -616,7 +616,7 @@ static int amdgpu_cgs_irq_put(struct
> cgs_device *cgs_device, unsigned src_id, un
> >   return amdgpu_irq_put(adev, adev->irq.sources[src_id], type);
> >  }
> >
> > -int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device,
> > +static int amdgpu_cgs_set_clockgating_state(struct cgs_device
> *cgs_device,
> > enum amd_ip_block_type block_type,
> > enum amd_clockgating_state state)
> >  {
> > @@ -637,7 +637,7 @@ int amdgpu_cgs_set_clockgating_state(struct
> cgs_device *cgs_device,
> >   return r;
> >  }
> >
> > -int amdgpu_cgs_set_powergating_state(struct cgs_device *cgs_device,
> > +static int amdgpu_cgs_set_powergating_state(struct cgs_device
> *cgs_device,
> > enum amd_ip_block_type block_type,
> > enum amd_powergating_state state)
> >  {
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > index 0307ff5..f65bdaf 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > @@ -287,7 +287,7 @@ static u64
> amdgpu_cs_get_threshold_for_moves(struct amdgpu_device *adev)
> >   return max(bytes_moved_threshold, 1024*1024ull);
> >  }
> >
> > -int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
> > +static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
> >   struct list_head *validated)
> >  {
> >   struct amdgpu_bo_list_entry *lobj;
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> > index 6674d40..31bfe3a 100644
> > --- 

Re: [PATCH] drm: amdgpu: mark symbols static where possible

2016-09-03 Thread Edward O'Callaghan


On 09/03/2016 04:23 PM, Baoyou Xie wrote:
> in drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c and
> drivers/gpu/drm/amd/amdgpu/cz_smc.c, there are two functions named
> cz_write_smc_sram_dword, but these two functions only have the same
> name, but in fact they are different functions, even their declarations
> is different.

Are you sure? Because apart from the crazy macro chain they look like
they wind up being the same to me.

> 
> On 3 September 2016 at 14:11, Edward O'Callaghan
> mailto:funfunc...@folklore1984.net>> wrote:
> 
> Reviewed-by: Edward O'Callaghan  >
> 
> Also, I just noticed cz_write_smc_sram_dword() and if I am not mistaken
> they seems identical in both:
>   drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c  and,
>   drivers/gpu/drm/amd/amdgpu/cz_smc.c
> with a personal preference to the powerplay version I suppose.
> 
> Similar story with cz_send_msg_to_smc_async() *I think* but the
> powerplay one uses some insane macro chain that dispatches to some
> function called smum_wait_for_register_unequal(), quite hard to follow..
> 
> Any way, that is out of scope of the patch here.
> 
> Kind Regards,
> Edward.
> 
> On 09/03/2016 03:57 PM, Baoyou Xie wrote:
> > We get a few warnings when building kernel with W=1:
> > drivers/gpu/drm/amd/amdgpu/cz_smc.c:51:5: warning: no previous
> prototype for 'cz_send_msg_to_smc_async' [-Wmissing-prototypes]
> > drivers/gpu/drm/amd/amdgpu/cz_smc.c:143:5: warning: no previous
> prototype for 'cz_write_smc_sram_dword' [-Wmissing-prototypes]
> > drivers/gpu/drm/amd/amdgpu/iceland_smc.c:124:6: warning: no
> previous prototype for 'iceland_start_smc' [-Wmissing-prototypes]
> > drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:3926:6: warning: no previous
> prototype for 'gfx_v8_0_rlc_stop' [-Wmissing-prototypes]
> > drivers/gpu/drm/amd/amdgpu/amdgpu_job.c:94:6: warning: no previous
> prototype for 'amdgpu_job_free_cb' [-Wmissing-prototypes]
> > 
> >
> > In fact, these functions are only used in the file in which they are
> > declared and don't need a declaration, but can be made static.
> > So this patch marks these functions with 'static'.
> >
> > Signed-off-by: Baoyou Xie  >
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c  | 4 ++--
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c   | 2 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_job.c  | 2 +-
> >  drivers/gpu/drm/amd/amdgpu/cz_smc.c  | 4 ++--
> >  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c| 2 +-
> >  drivers/gpu/drm/amd/amdgpu/iceland_smc.c | 8 
> >  6 files changed, 11 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> > index bc0440f..a831218 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> > @@ -616,7 +616,7 @@ static int amdgpu_cgs_irq_put(struct
> cgs_device *cgs_device, unsigned src_id, un
> >   return amdgpu_irq_put(adev, adev->irq.sources[src_id], type);
> >  }
> >
> > -int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device,
> > +static int amdgpu_cgs_set_clockgating_state(struct cgs_device
> *cgs_device,
> > enum amd_ip_block_type block_type,
> > enum amd_clockgating_state state)
> >  {
> > @@ -637,7 +637,7 @@ int amdgpu_cgs_set_clockgating_state(struct
> cgs_device *cgs_device,
> >   return r;
> >  }
> >
> > -int amdgpu_cgs_set_powergating_state(struct cgs_device *cgs_device,
> > +static int amdgpu_cgs_set_powergating_state(struct cgs_device
> *cgs_device,
> > enum amd_ip_block_type block_type,
> > enum amd_powergating_state state)
> >  {
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > index 0307ff5..f65bdaf 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > @@ -287,7 +287,7 @@ static u64
> amdgpu_cs_get_threshold_for_moves(struct amdgpu_device *adev)
> >   return max(bytes_moved_threshold, 1024*1024ull);
> >  }
> >
> > -int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
> > +static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
> >   struct list_head *validated)
> >  {
> >   struct amdgpu_bo_list_entry *lobj;
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> > index 6674d40..31bfe3a 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> > +++ 

Re: [PATCH] drm: amdgpu: mark symbols static where possible

2016-09-03 Thread Edward O'Callaghan
Reviewed-by: Edward O'Callaghan 

Also, I just noticed cz_write_smc_sram_dword() and if I am not mistaken
they seems identical in both:
  drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c  and,
  drivers/gpu/drm/amd/amdgpu/cz_smc.c
with a personal preference to the powerplay version I suppose.

Similar story with cz_send_msg_to_smc_async() *I think* but the
powerplay one uses some insane macro chain that dispatches to some
function called smum_wait_for_register_unequal(), quite hard to follow..

Any way, that is out of scope of the patch here.

Kind Regards,
Edward.

On 09/03/2016 03:57 PM, Baoyou Xie wrote:
> We get a few warnings when building kernel with W=1:
> drivers/gpu/drm/amd/amdgpu/cz_smc.c:51:5: warning: no previous prototype for 
> 'cz_send_msg_to_smc_async' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/cz_smc.c:143:5: warning: no previous prototype for 
> 'cz_write_smc_sram_dword' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/iceland_smc.c:124:6: warning: no previous 
> prototype for 'iceland_start_smc' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:3926:6: warning: no previous prototype 
> for 'gfx_v8_0_rlc_stop' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/amdgpu_job.c:94:6: warning: no previous prototype 
> for 'amdgpu_job_free_cb' [-Wmissing-prototypes]
> 
> 
> In fact, these functions are only used in the file in which they are
> declared and don't need a declaration, but can be made static.
> So this patch marks these functions with 'static'.
> 
> Signed-off-by: Baoyou Xie 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c  | 4 ++--
>  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c   | 2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_job.c  | 2 +-
>  drivers/gpu/drm/amd/amdgpu/cz_smc.c  | 4 ++--
>  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c| 2 +-
>  drivers/gpu/drm/amd/amdgpu/iceland_smc.c | 8 
>  6 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> index bc0440f..a831218 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> @@ -616,7 +616,7 @@ static int amdgpu_cgs_irq_put(struct cgs_device 
> *cgs_device, unsigned src_id, un
>   return amdgpu_irq_put(adev, adev->irq.sources[src_id], type);
>  }
>  
> -int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device,
> +static int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device,
> enum amd_ip_block_type block_type,
> enum amd_clockgating_state state)
>  {
> @@ -637,7 +637,7 @@ int amdgpu_cgs_set_clockgating_state(struct cgs_device 
> *cgs_device,
>   return r;
>  }
>  
> -int amdgpu_cgs_set_powergating_state(struct cgs_device *cgs_device,
> +static int amdgpu_cgs_set_powergating_state(struct cgs_device *cgs_device,
> enum amd_ip_block_type block_type,
> enum amd_powergating_state state)
>  {
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 0307ff5..f65bdaf 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -287,7 +287,7 @@ static u64 amdgpu_cs_get_threshold_for_moves(struct 
> amdgpu_device *adev)
>   return max(bytes_moved_threshold, 1024*1024ull);
>  }
>  
> -int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
> +static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
>   struct list_head *validated)
>  {
>   struct amdgpu_bo_list_entry *lobj;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> index 6674d40..31bfe3a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> @@ -91,7 +91,7 @@ void amdgpu_job_free_resources(struct amdgpu_job *job)
>   amdgpu_ib_free(job->adev, >ibs[i], f);
>  }
>  
> -void amdgpu_job_free_cb(struct amd_sched_job *s_job)
> +static void amdgpu_job_free_cb(struct amd_sched_job *s_job)
>  {
>   struct amdgpu_job *job = container_of(s_job, struct amdgpu_job, base);
>  
> diff --git a/drivers/gpu/drm/amd/amdgpu/cz_smc.c 
> b/drivers/gpu/drm/amd/amdgpu/cz_smc.c
> index ac7fee7..c80c2e9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cz_smc.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cz_smc.c
> @@ -48,7 +48,7 @@ static struct cz_smu_private_data *cz_smu_get_priv(struct 
> amdgpu_device *adev)
>   return priv;
>  }
>  
> -int cz_send_msg_to_smc_async(struct amdgpu_device *adev, u16 msg)
> +static int cz_send_msg_to_smc_async(struct amdgpu_device *adev, u16 msg)
>  {
>   int i;
>   u32 content = 0, tmp;
> @@ -140,7 +140,7 @@ int cz_read_smc_sram_dword(struct amdgpu_device *adev, 
> u32 smc_address,
>   return 0;
>  }
>  
> -int cz_write_smc_sram_dword(struct 

Re: [PATCH] drm: amdgpu: mark symbols static where possible

2016-09-03 Thread Edward O'Callaghan
Reviewed-by: Edward O'Callaghan 

Also, I just noticed cz_write_smc_sram_dword() and if I am not mistaken
they seems identical in both:
  drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c  and,
  drivers/gpu/drm/amd/amdgpu/cz_smc.c
with a personal preference to the powerplay version I suppose.

Similar story with cz_send_msg_to_smc_async() *I think* but the
powerplay one uses some insane macro chain that dispatches to some
function called smum_wait_for_register_unequal(), quite hard to follow..

Any way, that is out of scope of the patch here.

Kind Regards,
Edward.

On 09/03/2016 03:57 PM, Baoyou Xie wrote:
> We get a few warnings when building kernel with W=1:
> drivers/gpu/drm/amd/amdgpu/cz_smc.c:51:5: warning: no previous prototype for 
> 'cz_send_msg_to_smc_async' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/cz_smc.c:143:5: warning: no previous prototype for 
> 'cz_write_smc_sram_dword' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/iceland_smc.c:124:6: warning: no previous 
> prototype for 'iceland_start_smc' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:3926:6: warning: no previous prototype 
> for 'gfx_v8_0_rlc_stop' [-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/amdgpu_job.c:94:6: warning: no previous prototype 
> for 'amdgpu_job_free_cb' [-Wmissing-prototypes]
> 
> 
> In fact, these functions are only used in the file in which they are
> declared and don't need a declaration, but can be made static.
> So this patch marks these functions with 'static'.
> 
> Signed-off-by: Baoyou Xie 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c  | 4 ++--
>  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c   | 2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_job.c  | 2 +-
>  drivers/gpu/drm/amd/amdgpu/cz_smc.c  | 4 ++--
>  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c| 2 +-
>  drivers/gpu/drm/amd/amdgpu/iceland_smc.c | 8 
>  6 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> index bc0440f..a831218 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
> @@ -616,7 +616,7 @@ static int amdgpu_cgs_irq_put(struct cgs_device 
> *cgs_device, unsigned src_id, un
>   return amdgpu_irq_put(adev, adev->irq.sources[src_id], type);
>  }
>  
> -int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device,
> +static int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device,
> enum amd_ip_block_type block_type,
> enum amd_clockgating_state state)
>  {
> @@ -637,7 +637,7 @@ int amdgpu_cgs_set_clockgating_state(struct cgs_device 
> *cgs_device,
>   return r;
>  }
>  
> -int amdgpu_cgs_set_powergating_state(struct cgs_device *cgs_device,
> +static int amdgpu_cgs_set_powergating_state(struct cgs_device *cgs_device,
> enum amd_ip_block_type block_type,
> enum amd_powergating_state state)
>  {
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 0307ff5..f65bdaf 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -287,7 +287,7 @@ static u64 amdgpu_cs_get_threshold_for_moves(struct 
> amdgpu_device *adev)
>   return max(bytes_moved_threshold, 1024*1024ull);
>  }
>  
> -int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
> +static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
>   struct list_head *validated)
>  {
>   struct amdgpu_bo_list_entry *lobj;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> index 6674d40..31bfe3a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> @@ -91,7 +91,7 @@ void amdgpu_job_free_resources(struct amdgpu_job *job)
>   amdgpu_ib_free(job->adev, >ibs[i], f);
>  }
>  
> -void amdgpu_job_free_cb(struct amd_sched_job *s_job)
> +static void amdgpu_job_free_cb(struct amd_sched_job *s_job)
>  {
>   struct amdgpu_job *job = container_of(s_job, struct amdgpu_job, base);
>  
> diff --git a/drivers/gpu/drm/amd/amdgpu/cz_smc.c 
> b/drivers/gpu/drm/amd/amdgpu/cz_smc.c
> index ac7fee7..c80c2e9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cz_smc.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cz_smc.c
> @@ -48,7 +48,7 @@ static struct cz_smu_private_data *cz_smu_get_priv(struct 
> amdgpu_device *adev)
>   return priv;
>  }
>  
> -int cz_send_msg_to_smc_async(struct amdgpu_device *adev, u16 msg)
> +static int cz_send_msg_to_smc_async(struct amdgpu_device *adev, u16 msg)
>  {
>   int i;
>   u32 content = 0, tmp;
> @@ -140,7 +140,7 @@ int cz_read_smc_sram_dword(struct amdgpu_device *adev, 
> u32 smc_address,
>   return 0;
>  }
>  
> -int cz_write_smc_sram_dword(struct amdgpu_device *adev, u32 smc_address,
> +static int 

[PATCH] drm: amdgpu: mark symbols static where possible

2016-09-02 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/cz_smc.c:51:5: warning: no previous prototype for 
'cz_send_msg_to_smc_async' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/cz_smc.c:143:5: warning: no previous prototype for 
'cz_write_smc_sram_dword' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/iceland_smc.c:124:6: warning: no previous prototype 
for 'iceland_start_smc' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:3926:6: warning: no previous prototype 
for 'gfx_v8_0_rlc_stop' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c:94:6: warning: no previous prototype 
for 'amdgpu_job_free_cb' [-Wmissing-prototypes]


In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c  | 4 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c   | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c  | 2 +-
 drivers/gpu/drm/amd/amdgpu/cz_smc.c  | 4 ++--
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c| 2 +-
 drivers/gpu/drm/amd/amdgpu/iceland_smc.c | 8 
 6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
index bc0440f..a831218 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
@@ -616,7 +616,7 @@ static int amdgpu_cgs_irq_put(struct cgs_device 
*cgs_device, unsigned src_id, un
return amdgpu_irq_put(adev, adev->irq.sources[src_id], type);
 }
 
-int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device,
+static int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device,
  enum amd_ip_block_type block_type,
  enum amd_clockgating_state state)
 {
@@ -637,7 +637,7 @@ int amdgpu_cgs_set_clockgating_state(struct cgs_device 
*cgs_device,
return r;
 }
 
-int amdgpu_cgs_set_powergating_state(struct cgs_device *cgs_device,
+static int amdgpu_cgs_set_powergating_state(struct cgs_device *cgs_device,
  enum amd_ip_block_type block_type,
  enum amd_powergating_state state)
 {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 0307ff5..f65bdaf 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -287,7 +287,7 @@ static u64 amdgpu_cs_get_threshold_for_moves(struct 
amdgpu_device *adev)
return max(bytes_moved_threshold, 1024*1024ull);
 }
 
-int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
+static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
struct list_head *validated)
 {
struct amdgpu_bo_list_entry *lobj;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index 6674d40..31bfe3a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -91,7 +91,7 @@ void amdgpu_job_free_resources(struct amdgpu_job *job)
amdgpu_ib_free(job->adev, >ibs[i], f);
 }
 
-void amdgpu_job_free_cb(struct amd_sched_job *s_job)
+static void amdgpu_job_free_cb(struct amd_sched_job *s_job)
 {
struct amdgpu_job *job = container_of(s_job, struct amdgpu_job, base);
 
diff --git a/drivers/gpu/drm/amd/amdgpu/cz_smc.c 
b/drivers/gpu/drm/amd/amdgpu/cz_smc.c
index ac7fee7..c80c2e9 100644
--- a/drivers/gpu/drm/amd/amdgpu/cz_smc.c
+++ b/drivers/gpu/drm/amd/amdgpu/cz_smc.c
@@ -48,7 +48,7 @@ static struct cz_smu_private_data *cz_smu_get_priv(struct 
amdgpu_device *adev)
return priv;
 }
 
-int cz_send_msg_to_smc_async(struct amdgpu_device *adev, u16 msg)
+static int cz_send_msg_to_smc_async(struct amdgpu_device *adev, u16 msg)
 {
int i;
u32 content = 0, tmp;
@@ -140,7 +140,7 @@ int cz_read_smc_sram_dword(struct amdgpu_device *adev, u32 
smc_address,
return 0;
 }
 
-int cz_write_smc_sram_dword(struct amdgpu_device *adev, u32 smc_address,
+static int cz_write_smc_sram_dword(struct amdgpu_device *adev, u32 smc_address,
u32 value, u32 limit)
 {
int ret;
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index bff8668..6997f7c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -3923,7 +3923,7 @@ static void gfx_v8_0_init_pg(struct amdgpu_device *adev)
}
 }
 
-void gfx_v8_0_rlc_stop(struct amdgpu_device *adev)
+static void gfx_v8_0_rlc_stop(struct amdgpu_device *adev)
 {
u32 tmp = RREG32(mmRLC_CNTL);
 
diff --git a/drivers/gpu/drm/amd/amdgpu/iceland_smc.c 
b/drivers/gpu/drm/amd/amdgpu/iceland_smc.c
index 2118399..ef7c27d 100644
--- 

[PATCH] drm: amdgpu: mark symbols static where possible

2016-09-02 Thread Baoyou Xie
We get a few warnings when building kernel with W=1:
drivers/gpu/drm/amd/amdgpu/cz_smc.c:51:5: warning: no previous prototype for 
'cz_send_msg_to_smc_async' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/cz_smc.c:143:5: warning: no previous prototype for 
'cz_write_smc_sram_dword' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/iceland_smc.c:124:6: warning: no previous prototype 
for 'iceland_start_smc' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:3926:6: warning: no previous prototype 
for 'gfx_v8_0_rlc_stop' [-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c:94:6: warning: no previous prototype 
for 'amdgpu_job_free_cb' [-Wmissing-prototypes]


In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
So this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c  | 4 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c   | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c  | 2 +-
 drivers/gpu/drm/amd/amdgpu/cz_smc.c  | 4 ++--
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c| 2 +-
 drivers/gpu/drm/amd/amdgpu/iceland_smc.c | 8 
 6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
index bc0440f..a831218 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
@@ -616,7 +616,7 @@ static int amdgpu_cgs_irq_put(struct cgs_device 
*cgs_device, unsigned src_id, un
return amdgpu_irq_put(adev, adev->irq.sources[src_id], type);
 }
 
-int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device,
+static int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device,
  enum amd_ip_block_type block_type,
  enum amd_clockgating_state state)
 {
@@ -637,7 +637,7 @@ int amdgpu_cgs_set_clockgating_state(struct cgs_device 
*cgs_device,
return r;
 }
 
-int amdgpu_cgs_set_powergating_state(struct cgs_device *cgs_device,
+static int amdgpu_cgs_set_powergating_state(struct cgs_device *cgs_device,
  enum amd_ip_block_type block_type,
  enum amd_powergating_state state)
 {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 0307ff5..f65bdaf 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -287,7 +287,7 @@ static u64 amdgpu_cs_get_threshold_for_moves(struct 
amdgpu_device *adev)
return max(bytes_moved_threshold, 1024*1024ull);
 }
 
-int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
+static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
struct list_head *validated)
 {
struct amdgpu_bo_list_entry *lobj;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index 6674d40..31bfe3a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -91,7 +91,7 @@ void amdgpu_job_free_resources(struct amdgpu_job *job)
amdgpu_ib_free(job->adev, >ibs[i], f);
 }
 
-void amdgpu_job_free_cb(struct amd_sched_job *s_job)
+static void amdgpu_job_free_cb(struct amd_sched_job *s_job)
 {
struct amdgpu_job *job = container_of(s_job, struct amdgpu_job, base);
 
diff --git a/drivers/gpu/drm/amd/amdgpu/cz_smc.c 
b/drivers/gpu/drm/amd/amdgpu/cz_smc.c
index ac7fee7..c80c2e9 100644
--- a/drivers/gpu/drm/amd/amdgpu/cz_smc.c
+++ b/drivers/gpu/drm/amd/amdgpu/cz_smc.c
@@ -48,7 +48,7 @@ static struct cz_smu_private_data *cz_smu_get_priv(struct 
amdgpu_device *adev)
return priv;
 }
 
-int cz_send_msg_to_smc_async(struct amdgpu_device *adev, u16 msg)
+static int cz_send_msg_to_smc_async(struct amdgpu_device *adev, u16 msg)
 {
int i;
u32 content = 0, tmp;
@@ -140,7 +140,7 @@ int cz_read_smc_sram_dword(struct amdgpu_device *adev, u32 
smc_address,
return 0;
 }
 
-int cz_write_smc_sram_dword(struct amdgpu_device *adev, u32 smc_address,
+static int cz_write_smc_sram_dword(struct amdgpu_device *adev, u32 smc_address,
u32 value, u32 limit)
 {
int ret;
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index bff8668..6997f7c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -3923,7 +3923,7 @@ static void gfx_v8_0_init_pg(struct amdgpu_device *adev)
}
 }
 
-void gfx_v8_0_rlc_stop(struct amdgpu_device *adev)
+static void gfx_v8_0_rlc_stop(struct amdgpu_device *adev)
 {
u32 tmp = RREG32(mmRLC_CNTL);
 
diff --git a/drivers/gpu/drm/amd/amdgpu/iceland_smc.c 
b/drivers/gpu/drm/amd/amdgpu/iceland_smc.c
index 2118399..ef7c27d 100644
--- a/drivers/gpu/drm/amd/amdgpu/iceland_smc.c
+++